|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.gui.StandardListEditor
This reusable component is a list with buttons for adding and removing elements. The add button brings up a dialog window to retrieve the element to add from the user. The remove button is only enabled when there is an item selected in the list.
Constructor Summary | |
StandardListEditor(java.awt.event.ActionListener listener)
Creates a StandardListEditor with the default settings for the names of the add and remove buttons and that uses the specified ActionListener instance as the listener for the add button. |
|
StandardListEditor(java.lang.String INPUT_FIELD_KEY)
Creates a StandardListEditor with the list of elements on the left and buttons for adding and removing elements on the right. |
|
StandardListEditor(java.lang.String ADD_BUTTON_KEY,
java.lang.String REMOVE_BUTTON_KEY,
java.lang.String INPUT_FIELD_KEY)
More flexible constructor that allows the text for the add and remove buttons to be set and that allows a custom ActionListener for the add button. |
Method Summary | |
void |
addFile(java.io.File file)
Adds the specified File instance to the end of the list. |
void |
addString(java.lang.String string)
Adds the specified String instance to the end of the list. |
void |
clearSelection()
Clears the selections in the list. |
java.awt.Component |
getComponent()
Provides access to the wrapped Component of the StandardListEditor. |
java.io.File[] |
getDataAsFileArray()
Returns an array of the underlying data represented as File instances. |
java.lang.Object[] |
getDataAsObjectArray()
Returns an array of the underlying data represented as objects. |
java.lang.String[] |
getDataAsStringArray()
Returns an array of the underlying data represented as strings by calling toString() on each element. |
boolean |
getListChanged()
Returns whether or not the list has changed since the last call to reset the list. |
void |
resetList()
Resets the value for whether or not the list has changed to false. |
void |
setListData(java.io.File[] data)
Sets the data in the underlying ListModel. |
void |
setListData(java.lang.String[] data)
Sets the data in the underlying ListModel. |
void |
setListData(java.util.Vector data)
Sets the data in the underlying ListModel. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StandardListEditor(java.lang.String INPUT_FIELD_KEY)
OPTIONS_AUTO_CONNECT_INPUT_FIELD_LABEL=Enter Host Address:
in the messages bundle will make "Enter Host Address: " appear as the label for the text field in dialog window popped up by the "add" button.
INPUT_FIELD_KEY
- the key for the locale-specific label for the dialog
window popped up by the "Add..." buttonpublic StandardListEditor(java.awt.event.ActionListener listener)
public StandardListEditor(java.lang.String ADD_BUTTON_KEY, java.lang.String REMOVE_BUTTON_KEY, java.lang.String INPUT_FIELD_KEY)
ADD_BUTTON_KEY
- the key for the locale-specific string to use for
the add buttonREMOVE_BUTTON_KEY
- the key for the locale-specific string to use
for the remove buttonINPUT_FIELD_KEY
- the key for the locale-specific string to use
for the label in the generic text input component used by defaultMethod Detail |
public java.awt.Component getComponent()
public void addFile(java.io.File file)
file
- the File to addpublic void addString(java.lang.String string)
string
- the String to addpublic void setListData(java.util.Vector data)
data
- the Vector containing data for the modelpublic void setListData(java.io.File[] data)
data
- array of File instances containing the data for the
modelpublic void setListData(java.lang.String[] data)
data
- array of String instances containing the data for the
modelpublic void clearSelection()
public java.lang.String[] getDataAsStringArray()
public java.io.File[] getDataAsFileArray()
public java.lang.Object[] getDataAsObjectArray()
public boolean getListChanged()
public void resetList()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |