public class PersistentStateSupport
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
PersistentStateSupport.SerializationStrategy |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_CURRENT_FILE |
static java.lang.String |
PROPERTY_DIRTY |
static java.lang.String |
PROPERTY_OPENING |
static java.lang.String |
PROPERTY_SAVING |
Constructor and Description |
---|
PersistentStateSupport()
Creates a new instance of PersistentStateSupport
|
PersistentStateSupport(java.awt.Component parent,
PersistentStateSupport.SerializationStrategy strategy,
java.lang.String extension) |
PersistentStateSupport(DasCanvas canvas,
java.lang.String extension)
Provides a means for saving the application persistently, undo/redo support (TODO).
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a PropertyChangeListener to the listener list.
|
void |
close()
Deprecated.
What is the purpose of this method?
|
javax.swing.JLabel |
createCurrentFileLabel() |
javax.swing.Action |
createOpenAction() |
javax.swing.JMenu |
createOpenRecentMenu() |
javax.swing.Action |
createQuitAction()
In the future, this should prompt for save if the app is dirty.
|
javax.swing.Action |
createSaveAction() |
javax.swing.Action |
createSaveAsAction() |
javax.swing.JMenuItem |
createSaveMenuItem() |
java.io.File |
getCurrentFile() |
boolean |
isCurrentFileOpened()
Property currentFileOpened indicates if the current file has ever been opened.
|
boolean |
isDirty()
Getter for property dirty.
|
boolean |
isOpening()
Property loading is true when a load operation is being performed.
|
boolean |
isSaving()
Property saving is true when a save operation is being performed.
|
void |
markDirty() |
protected void |
openImpl(java.io.File file)
override me.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a PropertyChangeListener from the listener list.
|
void |
saveAs() |
protected void |
saveImpl(java.io.File f)
override me
|
void |
setCurrentFile(java.io.File currentFile) |
void |
setCurrentFileOpened(boolean currentFileOpened)
Setter for property currentFileOpened.
|
void |
setDirty(boolean dirty)
Setter for property dirty.
|
public static final java.lang.String PROPERTY_OPENING
public static final java.lang.String PROPERTY_SAVING
public static final java.lang.String PROPERTY_DIRTY
public static final java.lang.String PROPERTY_CURRENT_FILE
public PersistentStateSupport(DasCanvas canvas, java.lang.String extension)
public PersistentStateSupport(java.awt.Component parent, PersistentStateSupport.SerializationStrategy strategy, java.lang.String extension)
public PersistentStateSupport()
public javax.swing.Action createSaveAsAction()
public void saveAs()
protected void saveImpl(java.io.File f) throws java.lang.Exception
java.lang.Exception
public javax.swing.Action createSaveAction()
public javax.swing.Action createQuitAction()
public javax.swing.JMenuItem createSaveMenuItem()
public javax.swing.JMenu createOpenRecentMenu()
public javax.swing.JLabel createCurrentFileLabel()
public javax.swing.Action createOpenAction()
protected void openImpl(java.io.File file) throws java.lang.Exception
java.lang.Exception
public void close()
public void markDirty()
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
l
- The listener to add.public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
l
- The listener to remove.public boolean isDirty()
public void setDirty(boolean dirty)
dirty
- New value of property dirty.public java.io.File getCurrentFile()
public void setCurrentFile(java.io.File currentFile)
public boolean isOpening()
public boolean isSaving()
public boolean isCurrentFileOpened()
public void setCurrentFileOpened(boolean currentFileOpened)
currentFileOpened
- New value of property currentFileOpened.