|
JHotDraw 7rev733 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.AbstractAction
org.jhotdraw.app.action.AbstractApplicationAction
org.jhotdraw.app.action.file.OpenFileAction
public class OpenFileAction
Presents an URIChooser and loads the selected URI into an
empty view. If no empty view is available, a new view is created.
This action is called when the user selects the Open 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 ApplicationModel in method
ApplicationModel.initApplication(org.jhotdraw.app.Application).
This action is designed for applications which automatically
create a new view for each opened file. This action goes together with
NewFileAction, OpenDirectoryAction and CloseFileAction.
This action should not be used together with LoadFileAction.
Allow multiple views per URI
When the feature is disabled, OpenFileAction prevents opening an URI
which* is opened in another view.
See org.jhotdraw.app for a description of the feature.
Open last URI on launch
OpenFileAction supplies data for this feature by calling
Application.addRecentURI(java.net.URI) when it successfully opened a file.
See org.jhotdraw.app for a description of the feature.
| Field Summary | |
|---|---|
static java.lang.String |
ID
|
| Fields inherited from class javax.swing.AbstractAction |
|---|
changeSupport, enabled |
| Fields inherited from interface javax.swing.Action |
|---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
| Constructor Summary | |
|---|---|
OpenFileAction(Application app)
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
|
protected javax.swing.JDialog |
createDialog(URIChooser chooser,
java.awt.Component parent)
We implement JFileChooser.showDialog by ourselves, so that we can center dialogs properly on screen on Mac OS X. |
protected URIChooser |
getChooser(View view)
|
protected void |
openViewFromURI(View view,
java.net.URI uri,
URIChooser chooser)
|
int |
showDialog(URIChooser chooser,
java.awt.Component parent)
We implement JFileChooser.showDialog by ourselves, so that we can center dialogs properly on screen on Mac OS X. |
| Methods inherited from class org.jhotdraw.app.action.AbstractApplicationAction |
|---|
dispose, getApplication, installApplicationListeners, isEnabled, setEnabled, uninstallApplicationListeners, updateApplicationEnabled |
| Methods inherited from class javax.swing.AbstractAction |
|---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ID
| Constructor Detail |
|---|
public OpenFileAction(Application app)
| Method Detail |
|---|
protected URIChooser getChooser(View view)
public void actionPerformed(java.awt.event.ActionEvent evt)
protected void openViewFromURI(View view,
java.net.URI uri,
URIChooser chooser)
public int showDialog(URIChooser chooser,
java.awt.Component parent)
protected javax.swing.JDialog createDialog(URIChooser chooser,
java.awt.Component parent)
throws java.awt.HeadlessException
java.awt.HeadlessException
|
Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project. Some rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||