com.alee.extended.list
Class FileListModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by com.alee.laf.list.WebListModel<FileElement>
          extended by com.alee.extended.list.FileListModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.ListModel

public class FileListModel
extends WebListModel<FileElement>

Custom list model for WebFileList component.

Author:
Mikle Garin
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.alee.laf.list.WebListModel
delegate
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
FileListModel()
          Constructs empty file list model.
FileListModel(java.io.File directory)
          Constructs file list model with files from the specified directory.
FileListModel(java.io.File[] data)
          Constructs file list model with the specified files.
FileListModel(java.util.List<java.io.File> data)
          Constructs file list model with the specified files.
FileListModel(java.lang.String directoryPath)
          Constructs file list model with files from directory under the specified path.
 
Method Summary
protected  java.io.File[] getData(java.io.File directory)
          Returns files under the specified directory.
 FileElement getElement(java.io.File file)
          Returns FileElement for the specified file or null if it is not in the list.
 FileElement getElement(java.lang.String path)
          Returns FileElement for the file with specified path or null if it is not in the list.
 void setData(java.io.File directory)
          Clears list data and fills it with files from the specified directory.
 void setData(java.io.File[] data)
          Clears list data and fills it with specified files.
 void setData(java.util.List<java.io.File> data)
          Clears list data and fills it with specified files.
 void setData(java.lang.String directoryPath)
          Clears list data and fills it with files from directory under the specified path.
protected  java.util.List<FileElement> toElementsList(java.io.File[] data)
          Converts File array into FileElement list.
protected  java.util.List<FileElement> toElementsList(java.util.List<java.io.File> data)
          Converts File list into FileElement list.
 
Methods inherited from class com.alee.laf.list.WebListModel
add, add, addElement, addElements, addElements, capacity, clear, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, get, getElementAt, getElements, getSize, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAllAfter, removeAllBefore, removeAllElements, removeElement, removeElementAt, removeElements, removeElements, removeRange, set, setElementAt, setElements, setSize, size, toArray, toString, trimToSize, update
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileListModel

public FileListModel()
Constructs empty file list model.


FileListModel

public FileListModel(java.lang.String directoryPath)
Constructs file list model with files from directory under the specified path.

Parameters:
directoryPath - directory path

FileListModel

public FileListModel(java.io.File directory)
Constructs file list model with files from the specified directory.

Parameters:
directory - directory

FileListModel

public FileListModel(java.io.File[] data)
Constructs file list model with the specified files.

Parameters:
data - files array

FileListModel

public FileListModel(java.util.List<java.io.File> data)
Constructs file list model with the specified files.

Parameters:
data - files list
Method Detail

getElement

public FileElement getElement(java.io.File file)
Returns FileElement for the specified file or null if it is not in the list.

Parameters:
file - file to process
Returns:
FileElement for the specified file or null if it is not in the list

getElement

public FileElement getElement(java.lang.String path)
Returns FileElement for the file with specified path or null if it is not in the list.

Parameters:
path - file path to process
Returns:
FileElement for the file with specified path or null if it is not in the list

setData

public void setData(java.lang.String directoryPath)
Clears list data and fills it with files from directory under the specified path.

Parameters:
directoryPath - directory path to process

setData

public void setData(java.io.File directory)
Clears list data and fills it with files from the specified directory.

Parameters:
directory - directory to process

setData

public void setData(java.io.File[] data)
Clears list data and fills it with specified files.

Parameters:
data - files array

setData

public void setData(java.util.List<java.io.File> data)
Clears list data and fills it with specified files.

Parameters:
data - files list

getData

protected java.io.File[] getData(java.io.File directory)
Returns files under the specified directory.

Parameters:
directory - directory to process
Returns:
files array

toElementsList

protected java.util.List<FileElement> toElementsList(java.io.File[] data)
Converts File array into FileElement list.

Parameters:
data - File array to process
Returns:
FileElement list

toElementsList

protected java.util.List<FileElement> toElementsList(java.util.List<java.io.File> data)
Converts File list into FileElement list.

Parameters:
data - File list to process
Returns:
FileElement list