org.openscience.jmol.app

Class RecentFilesDialog

class RecentFilesDialog extends JDialog implements ActionListener, WindowListener

Manages a list of recently opened files.

Author: Bradley A. Smith (bradley@baysmith.com)

Field Summary
JButtoncancelButton
JListfileList
String[]files
static intMAX_FILES
JButtonokButton
Propertiesprops
StringselectedFileName
Constructor Summary
RecentFilesDialog(Frame boss)
Creates a hidden recent files dialog
Method Summary
voidactionPerformed(ActionEvent e)
voidaddFile(String name)
Adds this file to the history.
voidcancel()
voidclose()
StringgetFile()
voidgetFiles()
voidnotifyFileOpen(String fullPathName)
voidsaveList()
Saves the list to the history file.
voidwindowActivated(WindowEvent e)
voidwindowClosed(WindowEvent e)
voidwindowClosing(WindowEvent e)
voidwindowDeactivated(WindowEvent e)
voidwindowDeiconified(WindowEvent e)
voidwindowIconified(WindowEvent e)
voidwindowOpened(WindowEvent e)

Field Detail

cancelButton

private JButton cancelButton

fileList

JList fileList

files

String[] files

MAX_FILES

private static final int MAX_FILES

okButton

private JButton okButton

props

Properties props

selectedFileName

String selectedFileName

Constructor Detail

RecentFilesDialog

public RecentFilesDialog(Frame boss)
Creates a hidden recent files dialog

Parameters: boss

Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)

addFile

public void addFile(String name)
Adds this file to the history. If already present, this file is premoted to the top position.

Parameters: name Name of the file

cancel

void cancel()

close

void close()

getFile

public String getFile()

Returns: String The name of the file picked or null if the action was aborted.

getFiles

private void getFiles()

notifyFileOpen

public void notifyFileOpen(String fullPathName)

saveList

public void saveList()
Saves the list to the history file. Called automaticaly when files are added *

windowActivated

public void windowActivated(WindowEvent e)

windowClosed

public void windowClosed(WindowEvent e)

windowClosing

public void windowClosing(WindowEvent e)

windowDeactivated

public void windowDeactivated(WindowEvent e)

windowDeiconified

public void windowDeiconified(WindowEvent e)

windowIconified

public void windowIconified(WindowEvent e)

windowOpened

public void windowOpened(WindowEvent e)