|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IPwkAppState
Represents the current state of the PWKeep application. Currently, there is a one-to-one relationship between the application, the user interface, and the current file. That is, it is not possible to have more than one main window or more than one file open in the same application instance. To open multiple windows/files, you need to run multiple instances of the application.
The reason for this interface is so that lower-level components (such as the user interface) can have access to application-wide state without having direct access to the implementation.
| Field Summary | |
|---|---|
static int |
LOAD_FILE_STATUS_BAD_PASSPHRASE
|
static int |
LOAD_FILE_STATUS_OK
|
static int |
SAVE_FILE_STATUS_FILE_EXISTS
|
static int |
SAVE_FILE_STATUS_NEED_FILENAME
|
static int |
SAVE_FILE_STATUS_NEED_PASSPHRASE
|
static int |
SAVE_FILE_STATUS_OK
|
| Method Summary | |
|---|---|
void |
exit()
Exits the application. |
java.io.File |
getFile()
|
boolean |
getIsFileModified()
|
boolean |
getIsPassphraseSet()
|
com.fullspan.util.swing.TreeNodeListModel |
getListModel()
|
PwkModel |
getModel()
|
PwkTreeModel |
getTreeModel()
|
int |
loadFile(java.io.File file,
java.lang.String passphrase)
Loads a file. |
void |
newFile()
|
int |
saveFile()
Saves the current file. |
int |
saveFileAs(java.io.File file,
boolean okToOverwrite)
Saves the current file under a new name (or for the first time) |
void |
setIsFileModified(boolean isFileModified)
The user interface should call this with true when the
file has been modified |
void |
setPassphrase(java.lang.String passphrase)
Set the passphrase for the current file. |
boolean |
validatePassphrase(java.lang.String passphrase)
Validate the passphrase for the current file. |
| Field Detail |
|---|
static final int LOAD_FILE_STATUS_OK
static final int LOAD_FILE_STATUS_BAD_PASSPHRASE
static final int SAVE_FILE_STATUS_OK
static final int SAVE_FILE_STATUS_NEED_PASSPHRASE
static final int SAVE_FILE_STATUS_NEED_FILENAME
static final int SAVE_FILE_STATUS_FILE_EXISTS
| Method Detail |
|---|
void exit()
This method saves the current option settings before exiting.
java.io.File getFile()
boolean getIsFileModified()
boolean getIsPassphraseSet()
com.fullspan.util.swing.TreeNodeListModel getListModel()
PwkModel getModel()
PwkTreeModel getTreeModel()
int loadFile(java.io.File file,
java.lang.String passphrase)
throws PwkException
file - the file to loadpassphrase - the user-supplied passphrase for the file
PwkExceptionvoid newFile()
int saveFile()
throws PwkException
PwkException
int saveFileAs(java.io.File file,
boolean okToOverwrite)
throws PwkException
file - okToOverwrite - true if it's OK to overwrite the file if it
already exists; false to return SAVE_FILE_STATUS_FILE_EXISTS if
it already exists
PwkExceptionvoid setIsFileModified(boolean isFileModified)
true when the
file has been modified
isFileModified - true if the file has been modified (if the user
has made a change)void setPassphrase(java.lang.String passphrase)
passphrase - boolean validatePassphrase(java.lang.String passphrase)
passphrase -
java.lang.IllegalStateException - if no passphrase has yet been set
for the current file
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||