|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openpermis.editor.policy.ApplicationState
public final class ApplicationState
Describes persistent application state.
Field Summary | |
---|---|
private PropertyChangeSupport |
propertyChangeSupport
The property change support for bound properties. |
private String[] |
recentFiles
List of recent files, never null . |
private String |
workingDirectory
The working directory of the application. |
Constructor Summary | |
---|---|
ApplicationState()
Creates a new application state. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a property change listener that gets notified on bound property changes. |
void |
addRecentFiles(String file)
Convenience method to add a file entry to the recent files list. |
private void |
assertValidRecentFilesIndex(int index)
Checks if the specified recent files index is valid. |
String[] |
getRecentFiles()
Returns a clone of the recent files list of this application state. |
String |
getRecentFiles(int index)
Returns a recent files entry at the specified index. |
private String |
getRecentFilesAsString()
Returns a string representation for the recent files list. |
int |
getRecentFilesCount()
Returns the number of recent files stored at this application state. |
String |
getWorkingDirectory()
Returns the working directory bean property. |
File |
getWorkingDirectoryFile()
Returns the application working directory as file. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes the specified property change listener. |
void |
removeRecentFiles(int index)
Convenience method to remove the file entry at the specified index. |
void |
setRecentFiles(int index,
String file)
Sets the recent files entry at the specified index. |
void |
setRecentFiles(String[] files)
Sets the recent files list of this application state. |
void |
setWorkingDirectory(String workingDirectory)
Sets the working directory bean property. |
void |
setWorkingDirectoryFile(File file)
Sets the application working directory from the given file. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private String workingDirectory
private String[] recentFiles
null
.
private final PropertyChangeSupport propertyChangeSupport
Constructor Detail |
---|
public ApplicationState()
Method Detail |
---|
public void addPropertyChangeListener(PropertyChangeListener listener)
The same listener object may be added more than once, and will be called
as many times as it is added. If listener
is null
, no exception
is thrown and no action is taken.
listener
- the listener to add.public void removePropertyChangeListener(PropertyChangeListener listener)
If listener
was added more than once to the same event source,
it will be notified one less time after being removed. If listener
is
null
, or was never added, no exception is thrown and no action is taken.
listener
- the listener to remove.public String getWorkingDirectory()
Use the file version
if you are interested
in an actual File
object.
getWorkingDirectoryFile()
public void setWorkingDirectory(String workingDirectory)
Use the file version
if your source
is an actual File
object.
workingDirectory
- the working directory bean property.setWorkingDirectoryFile(File)
public File getWorkingDirectoryFile()
Convenience method for the working directory bean property.
getWorkingDirectory()
public void setWorkingDirectoryFile(File file)
If the file denotes a directory it is used as is, in case of a plain file the parent directory is chosen.
Convenience method for the working directory bean property.
file
- the working directory to set.setWorkingDirectory(String)
public String getRecentFiles(int index)
index
- the index of the recent files entry to retrieve.
null
if there is no such entry.public int getRecentFilesCount()
public String[] getRecentFiles()
null
.private void assertValidRecentFilesIndex(int index)
index
- the index to check.
IllegalArgumentException
- if the index is not valid.public void setRecentFiles(int index, String file)
index
- the index of the file entry to set, [0..getRecentFilesCount()
[.file
- the file to entry to set, null
to remove the entry.getRecentFilesCount()
IllegalArgumentException
- if the index is not a valid index.public void removeRecentFiles(int index)
This method changes the whole recent files list.
index
- the index of the file entry to set, [0..getRecentFilesCount()
[.
IllegalArgumentException
- if the index is not a valid index.public void addRecentFiles(String file)
This method does nothing if the file entry is null
or there is already a
file entry equal to the one specified contained.
This method changes the whole recent files list.
file
- the file entry to add, may be null
.public void setRecentFiles(String[] files)
files
- the new files list to set, null
to set an empty files list.private String getRecentFilesAsString()
public String toString()
toString
in class Object
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:22
Copyright (c) 2002-2007 Ergon Informatik AG