E - Editor component typeT - Editor value typepublic abstract class AbstractListCellEditor<E extends java.awt.Component,T> extends java.lang.Object implements ListCellEditor<E,T>
| Modifier and Type | Field and Description |
|---|---|
protected int |
clicksToEdit
Amount of mouse clicks required to start editing cell.
|
protected int |
editedCell
Last edited cell index.
|
protected E |
editor
Currently active editor.
|
protected java.awt.event.ComponentAdapter |
editorPositionUpdater
List resize adapter.
|
protected java.awt.event.KeyAdapter |
keyAdapter
List key adapter.
|
protected java.awt.event.MouseAdapter |
mouseAdapter
List mouse adapter.
|
protected T |
oldValue
Old value from the edited cell.
|
| Constructor and Description |
|---|
AbstractListCellEditor() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addEditor(javax.swing.JList list)
Adds cell editor into the list.
|
void |
cancelEdit(javax.swing.JList list)
Cancels list cell editing.
|
protected abstract E |
createCellEditor(javax.swing.JList list,
int index,
T value)
Creates list cell editor component for the cell nder specified index.
|
protected void |
createCellEditorListeners(javax.swing.JList list,
int index,
T value)
Creates listeners for list cell editor component.
|
void |
editCancelled(javax.swing.JList list,
int index)
Notifies that list cell editing was cancelled.
|
void |
editStarted(javax.swing.JList list,
int index)
Notifies that list cell editing has started.
|
void |
editStopped(javax.swing.JList list,
int index,
T oldValue,
T newValue)
Notifies that list cell editing has finished.
|
E |
getCellEditor(javax.swing.JList list,
int index,
T value)
Returns list cell editor created for the cell under specified index.
|
int |
getClicksToEdit()
Returns amount of mouse clicks required to start editing cell.
|
protected java.awt.Rectangle |
getEditorBounds(javax.swing.JList list,
int index,
T value)
Returns list cell editor bounds within the list.
|
protected java.awt.Rectangle |
getEditorBounds(javax.swing.JList list,
int index,
T value,
java.awt.Rectangle cellBounds)
Returns list cell editor bounds within the cell.
|
void |
install(javax.swing.JList list)
Installs cell editor in the list.
|
protected void |
installStartEditActions(javax.swing.JList list)
Installs start edit actions in the list.
|
boolean |
isCellEditable(javax.swing.JList list,
int index,
T value)
Returns whether list cell under the specified index is editable or not.
|
boolean |
isEditing()
Returns whether editor is currently active or not.
|
protected void |
removeEditor(javax.swing.JList list)
Removes cell editor from the list.
|
void |
setClicksToEdit(int clicksToEdit)
Sets amount of mouse clicks required to start editing cell.
|
void |
startEdit(javax.swing.JList list,
int index)
Starts specified list cell editing.
|
boolean |
stopEdit(javax.swing.JList list)
Stops list cell editing.
|
void |
uninstall(javax.swing.JList list)
Uninstalls cell editor from the list.
|
protected void |
uninstallStartEditActions(javax.swing.JList list)
Uninstalls start edit actions from the list.
|
boolean |
updateListModel(javax.swing.JList list,
int index,
T oldValue,
T newValue,
boolean updateSelection)
Returns whether value update operation completed successfully or not.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCellEditorValueprotected int editedCell
protected T oldValue
protected E extends java.awt.Component editor
protected java.awt.event.ComponentAdapter editorPositionUpdater
protected java.awt.event.MouseAdapter mouseAdapter
protected int clicksToEdit
protected java.awt.event.KeyAdapter keyAdapter
public void install(javax.swing.JList list)
ListCellEditorinstall in interface ListCellEditor<E extends java.awt.Component,T>list - list to processprotected void installStartEditActions(javax.swing.JList list)
list - list to processpublic void uninstall(javax.swing.JList list)
ListCellEditoruninstall in interface ListCellEditor<E extends java.awt.Component,T>list - list to processprotected void uninstallStartEditActions(javax.swing.JList list)
list - list to processpublic boolean isCellEditable(javax.swing.JList list,
int index,
T value)
ListCellEditorisCellEditable in interface ListCellEditor<E extends java.awt.Component,T>list - list to processindex - cell indexvalue - cell valuepublic E getCellEditor(javax.swing.JList list, int index, T value)
ListCellEditorgetCellEditor in interface ListCellEditor<E extends java.awt.Component,T>list - list to processindex - cell indexvalue - cell valueprotected abstract E createCellEditor(javax.swing.JList list, int index, T value)
list - list to processindex - cell indexvalue - cell valueprotected void createCellEditorListeners(javax.swing.JList list,
int index,
T value)
list - list to processindex - cell indexvalue - cell valuepublic void startEdit(javax.swing.JList list,
int index)
ListCellEditorstartEdit in interface ListCellEditor<E extends java.awt.Component,T>list - list to processindex - cell indexpublic void cancelEdit(javax.swing.JList list)
ListCellEditorcancelEdit in interface ListCellEditor<E extends java.awt.Component,T>list - list to processpublic boolean stopEdit(javax.swing.JList list)
ListCellEditorstopEdit in interface ListCellEditor<E extends java.awt.Component,T>list - list to processprotected void addEditor(javax.swing.JList list)
list - list to processprotected void removeEditor(javax.swing.JList list)
list - list to processprotected java.awt.Rectangle getEditorBounds(javax.swing.JList list,
int index,
T value,
java.awt.Rectangle cellBounds)
list - list to processindex - cell indexvalue - cell valuecellBounds - cell boundsprotected java.awt.Rectangle getEditorBounds(javax.swing.JList list,
int index,
T value)
list - list to processindex - cell indexvalue - cell valuepublic boolean updateListModel(javax.swing.JList list,
int index,
T oldValue,
T newValue,
boolean updateSelection)
ListCellEditorupdateListModel in interface ListCellEditor<E extends java.awt.Component,T>list - list to processindex - cell indexoldValue - old cell valuenewValue - new cell valueupdateSelection - whether update list selection or notpublic void editStarted(javax.swing.JList list,
int index)
ListCellEditoreditStarted in interface ListCellEditor<E extends java.awt.Component,T>list - list to processindex - edited cell indexpublic void editStopped(javax.swing.JList list,
int index,
T oldValue,
T newValue)
ListCellEditoreditStopped in interface ListCellEditor<E extends java.awt.Component,T>list - list to processindex - edited cell indexoldValue - old cell valuenewValue - new cell valuepublic void editCancelled(javax.swing.JList list,
int index)
ListCellEditoreditCancelled in interface ListCellEditor<E extends java.awt.Component,T>list - list to processindex - edited cell indexpublic boolean isEditing()
ListCellEditorisEditing in interface ListCellEditor<E extends java.awt.Component,T>public int getClicksToEdit()
public void setClicksToEdit(int clicksToEdit)
clicksToEdit - amount of mouse clicks required to start editing cell