org.argouml.uml.ui
Class ActionFileOperations
java.lang.Object
javax.swing.AbstractAction
org.argouml.uml.ui.ActionFileOperations
- All Implemented Interfaces:
- Action, ActionListener, Cloneable, EventListener, Serializable
- Direct Known Subclasses:
- ActionNew, ActionOpenProject, ActionReopenProject, ActionRevertToSaved, ActionSaveProject
- public abstract class ActionFileOperations
- extends AbstractAction
This class provides common functions for all FileOperations
like new, save, load, and reopen.
- See Also:
- Serialized Form
Method Summary |
protected boolean |
askConfirmationAndSave()
If the current project is dirty (needs saving) then this function will
ask confirmation from the user. |
boolean |
loadProject(File file,
boolean showUI)
Loads the project file and opens all kinds of error message windows
if it doesn't work for some reason. |
private void |
reportError(String message,
boolean showUI)
Open a Message Dialog with an error message. |
private void |
reportError(String message,
boolean showUI,
Throwable ex)
Open a Message Dialog with an error message. |
LOG
private static final Logger LOG
ActionFileOperations
public ActionFileOperations(String name)
- The constructor.
- Parameters:
name
- the name of the action
ActionFileOperations
public ActionFileOperations(String name,
Icon icon)
- The constructor.
- Parameters:
name
- the name of the actionicon
- the icon to represent this action graphically
askConfirmationAndSave
protected boolean askConfirmationAndSave()
- If the current project is dirty (needs saving) then this function will
ask confirmation from the user.
If the user indicates that saving is needed, then saving is attempted.
- Returns:
- true if we can continue with opening
loadProject
public boolean loadProject(File file,
boolean showUI)
- Loads the project file and opens all kinds of error message windows
if it doesn't work for some reason. In those cases it preserves
the old project.
- Parameters:
file
- the file to open.showUI
- true if an error message may be shown to the user,
false if run in commandline mode
- Returns:
- true if the file was successfully opened
reportError
private void reportError(String message,
boolean showUI)
- Open a Message Dialog with an error message.
- Parameters:
message
- the message to display.showUI
- true if an error message may be shown to the user,
false if run in commandline mode
reportError
private void reportError(String message,
boolean showUI,
Throwable ex)
- Open a Message Dialog with an error message.
- Parameters:
message
- the message to display.showUI
- true if an error message may be shown to the user,
false if run in commandline mode