com.alee.extended.list
Class WebFileListCellEditor

java.lang.Object
  extended by com.alee.laf.list.editor.AbstractListCellEditor<WebTextField,FileElement>
      extended by com.alee.extended.list.WebFileListCellEditor
All Implemented Interfaces:
ListCellEditor<WebTextField,FileElement>

public class WebFileListCellEditor
extends AbstractListCellEditor<WebTextField,FileElement>

Custom list cell editor used in WebFileList component.

Author:
Mikle Garin

Field Summary
protected  java.lang.Object savedSelection
          Last saved selection.
 
Fields inherited from class com.alee.laf.list.editor.AbstractListCellEditor
clicksToEdit, editedCell, editor, editorPositionUpdater, keyAdapter, mouseAdapter, oldValue
 
Constructor Summary
WebFileListCellEditor()
           
 
Method Summary
protected  WebTextField createCellEditor(javax.swing.JList list, int index, FileElement value)
          Creates list cell editor component for the cell nder specified index.
 FileElement getCellEditorValue(javax.swing.JList list, int index, FileElement oldValue)
          Returns editor value that will replace the specified old value in the model.
protected  java.awt.Rectangle getEditorBounds(javax.swing.JList list, int index, FileElement value, java.awt.Rectangle cellBounds)
          Returns list cell editor bounds within the cell.
protected  void installStartEditActions(javax.swing.JList list)
          Installs start edit actions in the list.
 boolean isCellEditable(javax.swing.JList list, int index, FileElement value)
          Returns whether list cell under the specified index is editable or not.
protected  void uninstallStartEditActions(javax.swing.JList list)
          Uninstalls start edit actions from the list.
 boolean updateListModel(javax.swing.JList list, int index, FileElement oldValue, FileElement newValue, boolean updateSelection)
          Returns whether value update operation completed successfully or not.
 
Methods inherited from class com.alee.laf.list.editor.AbstractListCellEditor
addEditor, cancelEdit, createCellEditorListeners, editCancelled, editStarted, editStopped, getCellEditor, getClicksToEdit, getEditorBounds, install, isEditing, removeEditor, setClicksToEdit, startEdit, stopEdit, uninstall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

savedSelection

protected java.lang.Object savedSelection
Last saved selection.

Constructor Detail

WebFileListCellEditor

public WebFileListCellEditor()
Method Detail

installStartEditActions

protected void installStartEditActions(javax.swing.JList list)
Installs start edit actions in the list.

Overrides:
installStartEditActions in class AbstractListCellEditor<WebTextField,FileElement>
Parameters:
list - list to process

uninstallStartEditActions

protected void uninstallStartEditActions(javax.swing.JList list)
Uninstalls start edit actions from the list.

Overrides:
uninstallStartEditActions in class AbstractListCellEditor<WebTextField,FileElement>
Parameters:
list - list to process

isCellEditable

public boolean isCellEditable(javax.swing.JList list,
                              int index,
                              FileElement value)
Returns whether list cell under the specified index is editable or not.

Specified by:
isCellEditable in interface ListCellEditor<WebTextField,FileElement>
Overrides:
isCellEditable in class AbstractListCellEditor<WebTextField,FileElement>
Parameters:
list - list to process
index - cell index
value - cell value
Returns:
whether list cell under the specified index is editable or not

createCellEditor

protected WebTextField createCellEditor(javax.swing.JList list,
                                        int index,
                                        FileElement value)
Creates list cell editor component for the cell nder specified index.

Specified by:
createCellEditor in class AbstractListCellEditor<WebTextField,FileElement>
Parameters:
list - list to process
index - cell index
value - cell value
Returns:
list cell editor created for the cell under specified index

getEditorBounds

protected java.awt.Rectangle getEditorBounds(javax.swing.JList list,
                                             int index,
                                             FileElement value,
                                             java.awt.Rectangle cellBounds)
Returns list cell editor bounds within the cell.

Overrides:
getEditorBounds in class AbstractListCellEditor<WebTextField,FileElement>
Parameters:
list - list to process
index - cell index
value - cell value
cellBounds - cell bounds
Returns:
list cell editor bounds within the list

getCellEditorValue

public FileElement getCellEditorValue(javax.swing.JList list,
                                      int index,
                                      FileElement oldValue)
Returns editor value that will replace the specified old value in the model.

Parameters:
list - list to process
index - cell index
oldValue - old cell value
Returns:
editor value

updateListModel

public boolean updateListModel(javax.swing.JList list,
                               int index,
                               FileElement oldValue,
                               FileElement newValue,
                               boolean updateSelection)
Returns whether value update operation completed successfully or not. Basically this method should replace old value with a new one in list model and update list view.

Specified by:
updateListModel in interface ListCellEditor<WebTextField,FileElement>
Overrides:
updateListModel in class AbstractListCellEditor<WebTextField,FileElement>
Parameters:
list - list to process
index - cell index
oldValue - old cell value
newValue - new cell value
updateSelection - whether update list selection or not
Returns:
true if list model was updated