|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.utep.cs.et.gui.FileActionFactory
public class FileActionFactory
A factory class to create various file manipulation actions. These
actions are used to create (file) menu items or tool bar items (
see the class MenuFactory).
| Nested Class Summary | |
|---|---|
private static class |
FileActionFactory.JavaFileFilter
A file filter class to filter out non-java files. |
private static class |
FileActionFactory.PrinterSetupThread
A thread class to set up the page layout for printing. |
private static class |
FileActionFactory.PrintingThread
A thread class to print document. |
| Field Summary | |
|---|---|
private static AbstractAction |
actClose
The action for the close menu. |
private static AbstractAction |
actExit
The action for the exit menu. |
private static AbstractAction |
actNew
The action for the new menu. |
private static AbstractAction |
actOpen
The action for the open menu. |
private static AbstractAction |
actPopDelete
The action for the popup delete menu. |
private static AbstractAction |
actPopNew
The action for the popup new menu. |
private static AbstractAction |
actPopOpen
The action for the load menu. |
private static AbstractAction |
actPopRefresh
The action for the popup refresh menu. |
private static AbstractAction |
actPopRootDir
The action for the popup change root dir menu. |
private static AbstractAction |
actPopTest
The action for the Popup test menu. |
private static AbstractAction |
actPrint
The action for the print menu. |
private static AbstractAction |
actPrinterSetup
The action for the printer setup menu. |
private static AbstractAction |
actSave
The action for the save menu. |
private static AbstractAction |
actSaveAs
The action for the save as menu. |
private static JFileChooser |
chooser
The file chooser to prompt the user to choose a file. |
protected static File |
currentFile
The current file being edited. |
private static JFileChooser |
dirChooser
The file chooser to prompt the user to choose a directory. |
protected Mainable |
et
The main program. |
protected JFrame |
frame
The main frame of this program. |
private static PageFormat |
pageFormat
The page format for printing. |
| Constructor Summary | |
|---|---|
FileActionFactory(Mainable et)
Creates a new instance for the given tool et. |
|
| Method Summary | |
|---|---|
private void |
changeRootDir()
Change the root directory of the directory browser. |
private void |
doDrop(String filename)
Drops the given file on the tool by opening it. |
private void |
doNew()
Starts a new document by saving the current buffer if there are unsaved changes. |
private boolean |
fileSaveAs()
Saves the contents of the editor buffer to a file by prompting the user for a (new) file name. |
AbstractAction |
getClose()
Returns an action for the close menu item. |
DropTarget |
getDropTarget()
Returns a drop target object that accepts dropping of files on the Java editor. |
AbstractAction |
getExit()
Returns an action for the exit menu item. |
protected ImageIcon |
getIcon(String name)
Returns an image icon whose image is read from the file named name. |
AbstractAction |
getNew()
Returns an action for the new menu item. |
private File |
getNewSaveFile()
|
AbstractAction |
getOpen()
Returns an action for the open menu item. |
AbstractAction |
getPopDelete()
Returns an action for the popup delete menu item. |
AbstractAction |
getPopNew()
Returns an action for the popup new menu item. |
AbstractAction |
getPopOpen()
Returns the open action for the popup menu. |
AbstractAction |
getPopRefresh()
Returns an action for the popup refresh menu item. |
AbstractAction |
getPopRootDir()
Returns an action for the popup change root dir menu item. |
AbstractAction |
getPopTest()
|
AbstractAction |
getPrint()
Returns an action for the print menu item. |
AbstractAction |
getPrinterSetup()
Returns an action for the printer setup menu item. |
AbstractAction |
getSave()
Returns an action for the save menu item. |
AbstractAction |
getSaveAs()
Returns an action for the save as menu item. |
private File |
getSaveFile()
Returns a (new) file to save the contents of the editor buffer. |
protected boolean |
saveIfModified()
Saves the contents of the editor buffer only if there are unsaved changes. |
protected void |
setCurrentFile(File file)
Sets the given file to be the current file being edited. |
static void |
updatePopupActions(File file)
Enables or Disables the popup actions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static AbstractAction actNew
private static AbstractAction actOpen
private static AbstractAction actClose
private static AbstractAction actSave
private static AbstractAction actSaveAs
private static AbstractAction actPrinterSetup
private static AbstractAction actPrint
private static AbstractAction actExit
private static AbstractAction actPopOpen
private static AbstractAction actPopTest
private static AbstractAction actPopDelete
private static AbstractAction actPopNew
private static AbstractAction actPopRootDir
private static AbstractAction actPopRefresh
private static JFileChooser chooser
private static JFileChooser dirChooser
private static PageFormat pageFormat
protected final Mainable et
protected final JFrame frame
protected static File currentFile
| Constructor Detail |
|---|
public FileActionFactory(Mainable et)
et.
| Method Detail |
|---|
public AbstractAction getNew()
assignable actNew;
public AbstractAction getOpen()
assignable actOpen;
private void doDrop(String filename)
public AbstractAction getSave()
assignable actSave;
public AbstractAction getSaveAs()
assignable actSaveAs;
public AbstractAction getPrint()
assignable actPrint;
public AbstractAction getPrinterSetup()
assignable actPrinterSetup;
public AbstractAction getClose()
assignable actClose;
public AbstractAction getExit()
exit menu item.
assignable actExit;
public AbstractAction getPopOpen()
assignable actPopOpen;
public AbstractAction getPopTest()
public AbstractAction getPopDelete()
assignable actPopDelete;
public AbstractAction getPopNew()
assignable actPopNew;
public AbstractAction getPopRefresh()
assignable actPopRefresh;
public AbstractAction getPopRootDir()
private void changeRootDir()
public DropTarget getDropTarget()
public static void updatePopupActions(File file)
protected ImageIcon getIcon(String name)
name. A null is returned if reading the file fails.
protected void setCurrentFile(File file)
private void doNew()
assignable actSave, currentFile;
private boolean fileSaveAs()
protected boolean saveIfModified()
private File getSaveFile()
private File getNewSaveFile()
|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||