|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel uic.widgets.filechooser.SimpleFileView
public class SimpleFileView
Simple File view Class. Shows a multi column list with file names and its icons. Does not fetch its size/date and other stuff that might slow down the view It does sorting
This component can be used as a seperate component to browse files, or as a "view" whithin the uic FileChooser
MainWindow mw = new MainWindow();
final SimpleileView view = new SimpleileView();
view.updateView(new File[]{new File(System.getProperty("user.home"))});
mw.setComponent(view);
view.addFileSelectionListener(new FileSelectionListener() {
public void fileAccepted(File selectedFile) {
view.updateView(selectedFile.listFiles());
}
public void setSelectedFile(File selectedFile) {}
public void setSelectedFiles(File[] selectedFiles) {}
});
mw.show();
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
protected |
SimpleFileView()
|
Method Summary | |
---|---|
void |
acceptFileAt(int row)
Accepts the file in the current row. |
void |
addFileSelectionListener(FileSelectionListener listener)
Get notified when a file has been selected. |
void |
clearView()
Removes all data from the current view. |
protected void |
fireFileAccepted(File file)
Notify FileSelectionListener of a file accepted event. |
protected void |
fireFileSelectionChanged(File file)
Notify FileSelectionListener of a file selection event. |
protected void |
guiInit()
|
void |
overrideUISettings()
|
void |
removeFileSelectionListener(FileSelectionListener listener)
Remove notification when a file has been selected. |
void |
selectFileAt(int row)
Selects the file in the current row. |
void |
setMultipleSelection(boolean multipleSelection)
Set the multi selection value of this view. |
protected void |
setSelectedFile(File selectedFile)
|
protected void |
setSelectedFiles(File[] selectedFiles)
|
void |
updateView(File[] files)
Show the given files in this view. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected SimpleFileView()
Method Detail |
---|
protected void guiInit()
public void overrideUISettings()
overrideUISettings
in interface FileView
public void addFileSelectionListener(FileSelectionListener listener)
addFileSelectionListener
in interface FileView
public void removeFileSelectionListener(FileSelectionListener listener)
removeFileSelectionListener
in interface FileView
public void setMultipleSelection(boolean multipleSelection)
setMultipleSelection
in interface FileView
multipleSelection
- true when multiple files can be selectedpublic void clearView()
clearView
in interface FileView
public void updateView(File[] files)
updateView
in interface FileView
files
- the files that need to be shown. They do not have to be sorted.public void selectFileAt(int row)
row
- the row that contains the file information.public void acceptFileAt(int row)
row
- the row that contains the file information.protected void fireFileAccepted(File file)
file
- the file that has been acceptedprotected void fireFileSelectionChanged(File file)
file
- the file that has been selectedprotected void setSelectedFile(File selectedFile)
protected void setSelectedFiles(File[] selectedFiles)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |