org.jhotdraw.app.action.file
Class LoadFileAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.jhotdraw.app.action.AbstractViewAction
-
- org.jhotdraw.app.action.AbstractSaveUnsavedChangesAction
-
- org.jhotdraw.app.action.file.LoadFileAction
-
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
- Direct Known Subclasses:
- LoadDirectoryAction
public class LoadFileAction extends AbstractSaveUnsavedChangesAction
Lets the user save unsaved changes of the active view, then presents anURIChooserand loads the selected URI into the active view.This action is called when the user selects the Load item in the File menu. The menu item is automatically created by the application. A Recent Files sub-menu is also automatically generated.
If you want this behavior in your application, you have to create it and put it in your
ApplicationModelin methodApplicationModel.initApplication(org.jhotdraw.app.Application).This action is designed for applications which do not automatically create a new view for each opened file. This action goes together with
ClearFileAction,NewWindowAction,LoadFileAction,LoadDirectoryActionandCloseFileAction. This action should not be used together withOpenFileAction.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringID-
Fields inherited from class org.jhotdraw.app.action.AbstractViewAction
ENABLED_PROPERTY, VIEW_PROPERTY
-
-
Constructor Summary
Constructors Constructor and Description LoadFileAction(Application app, View view)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddoIt(View view)voidloadViewFromURI(View view, java.net.URI uri, URIChooser chooser)-
Methods inherited from class org.jhotdraw.app.action.AbstractSaveUnsavedChangesAction
actionPerformed
-
Methods inherited from class org.jhotdraw.app.action.AbstractViewAction
getActiveView, getApplication, isEnabled, setEnabled
-
-
-
-
Field Detail
-
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LoadFileAction
public LoadFileAction(Application app, @Nullable View view)
Creates a new instance.
-
-
Method Detail
-
doIt
public void doIt(View view)
-
loadViewFromURI
public void loadViewFromURI(View view, java.net.URI uri, URIChooser chooser)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG