A component that displays the files in a directory as a listbox. More...
Inherits ListBox, DirectoryContentsDisplayComponent, ListBoxModel, and ChangeListener.
Public Member Functions | |
| FileListComponent (DirectoryContentsList &listToShow) | |
| Creates a listbox to show the contents of a specified directory. | |
| ~FileListComponent () | |
| Destructor. | |
| int | getNumSelectedFiles () const |
| Returns the number of files the user has got selected. | |
| File | getSelectedFile (int index=0) const |
| Returns one of the files that the user has currently selected. | |
| void | deselectAllFiles () |
| Deselects any files that are currently selected. | |
| void | scrollToTop () |
| Scrolls to the top of the list. | |
| void | setSelectedFile (const File &) |
| If the specified file is in the list, it will become the only selected item (and if the file isn't in the list, all other items will be deselected). | |
| void | changeListenerCallback (ChangeBroadcaster *) |
| int | getNumRows () |
| void | paintListBoxItem (int, Graphics &, int, int, bool) |
| Component * | refreshComponentForRow (int rowNumber, bool isRowSelected, Component *existingComponentToUpdate) |
| void | selectedRowsChanged (int lastRowSelected) |
| void | deleteKeyPressed (int currentSelectedRow) |
| void | returnKeyPressed (int currentSelectedRow) |
A component that displays the files in a directory as a listbox.
This implements the DirectoryContentsDisplayComponent base class so that it can be used in a FileBrowserComponent.
To attach a listener to it, use its DirectoryContentsDisplayComponent base class and the FileBrowserListener class.
| FileListComponent::FileListComponent | ( | DirectoryContentsList & | listToShow | ) |
Creates a listbox to show the contents of a specified directory.
Destructor.
| int FileListComponent::getNumSelectedFiles | ( | ) | const [virtual] |
Returns the number of files the user has got selected.
Implements DirectoryContentsDisplayComponent.
| File FileListComponent::getSelectedFile | ( | int | index = 0 | ) | const [virtual] |
Returns one of the files that the user has currently selected.
The index should be in the range 0 to (getNumSelectedFiles() - 1).
Implements DirectoryContentsDisplayComponent.
| void FileListComponent::deselectAllFiles | ( | ) | [virtual] |
Deselects any files that are currently selected.
Implements DirectoryContentsDisplayComponent.
| void FileListComponent::scrollToTop | ( | ) | [virtual] |
Scrolls to the top of the list.
Implements DirectoryContentsDisplayComponent.
| void FileListComponent::setSelectedFile | ( | const File & | ) | [virtual] |
If the specified file is in the list, it will become the only selected item (and if the file isn't in the list, all other items will be deselected).
Implements DirectoryContentsDisplayComponent.
| void FileListComponent::changeListenerCallback | ( | ChangeBroadcaster * | ) | [virtual] |
Implements ChangeListener.
| int FileListComponent::getNumRows | ( | ) | [virtual] |
Implements ListBoxModel.
| void FileListComponent::paintListBoxItem | ( | int | , |
| Graphics & | , | ||
| int | , | ||
| int | , | ||
| bool | |||
| ) | [virtual] |
Implements ListBoxModel.
| Component* FileListComponent::refreshComponentForRow | ( | int | rowNumber, |
| bool | isRowSelected, | ||
| Component * | existingComponentToUpdate | ||
| ) | [virtual] |
Reimplemented from ListBoxModel.
| void FileListComponent::selectedRowsChanged | ( | int | lastRowSelected | ) | [virtual] |
Reimplemented from ListBoxModel.
| void FileListComponent::deleteKeyPressed | ( | int | currentSelectedRow | ) | [virtual] |
Reimplemented from ListBoxModel.
| void FileListComponent::returnKeyPressed | ( | int | currentSelectedRow | ) | [virtual] |
Reimplemented from ListBoxModel.