|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmars.venus.FileStatus
public class FileStatus
Used to store and return information on the status of the current ASM file that is being edited in the program.
Field Summary | |
---|---|
static int |
EDITED
open/saved edit window with unsaved edits |
static int |
NEW_EDITED
New edit window with unsaved edits |
static int |
NEW_NOT_EDITED
New edit window with no edits |
static int |
NO_FILE
initial state or after close |
static int |
NOT_EDITED
open/saved edit window with no edits |
static int |
OPENING
file is being opened. |
static int |
RUNNABLE
successful assembly |
static int |
RUNNING
execution is under way |
static int |
TERMINATED
execution terminated |
Constructor Summary | |
---|---|
FileStatus()
Create a FileStatus object with FileStatis.NO_FILE for status and null for file getters. |
|
FileStatus(int status,
String pathname)
Create a FileStatus object with given status and file pathname. |
Method Summary | |
---|---|
static int |
get()
Get file status |
static File |
getFile()
Returns the ASM file. |
String |
getFilename()
Get file name with no path information. |
int |
getFileStatus()
Get editing status of this file. |
static String |
getName()
Returns the name of the file. |
String |
getParent()
Get file parent pathname. |
String |
getPathname()
Get full file pathname. |
boolean |
hasUnsavedEdits()
Determine if file has been modified since last save or, if not yet saved, since being created using New or Open. |
static boolean |
isAssembled()
Tells whether the file has been assembled. |
static boolean |
isEdited()
Tells whether the file has been edited since it has been saved. |
boolean |
isNew()
Determine if file is "new", which means created using New but not yet saved. |
static boolean |
isSaved()
Tells whether the file has been saved. |
static void |
reset()
Resets all the values in FileStatus |
static void |
set(int newStatus)
Set file status. |
static void |
setAssembled(boolean b)
Changes the value of assenbked to the parameter given. |
static void |
setEdited(boolean b)
Changes the value of edited to the parameter given. |
static void |
setFile(File f)
Sets the file to the ASM file passed. |
void |
setFileStatus(int newStatus)
Set editing status of this file. |
static void |
setName(String s)
Changes the value of name to the parameter given. |
void |
setPathname(String newPath)
Set full file pathname. |
void |
setPathname(String parent,
String name)
Set full file pathname. |
static void |
setSaved(boolean b)
Changes the value of saved to the parameter given. |
void |
updateStaticFileStatus()
Update static FileStatus fields with values from this FileStatus object To support legacy code that depends on the static. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NO_FILE
public static final int NEW_NOT_EDITED
public static final int NEW_EDITED
public static final int NOT_EDITED
public static final int EDITED
public static final int RUNNABLE
public static final int RUNNING
public static final int TERMINATED
public static final int OPENING
Constructor Detail |
---|
public FileStatus()
public FileStatus(int status, String pathname)
status
- Initial file status. See FileStatus static constants.pathname
- Full file pathname. See setPathname(String newPath) below.Method Detail |
---|
public static void set(int newStatus)
newStatus
- New status: EDITED, RUNNABLE, etc, see list above.public static int get()
public static void setAssembled(boolean b)
b
- boolean variable that tells what to set assembled to.public static void setSaved(boolean b)
b
- boolean variable that tells what to set saved to .public static void setEdited(boolean b)
b
- boolean variable that tells what to set edited to.public static void setName(String s)
s
- string variable tells what to set the name of the file to .public static void setFile(File f)
f
- file object variable that stores the ASM file.public static File getFile()
public static String getName()
public static boolean isAssembled()
public static boolean isSaved()
public static boolean isEdited()
public static void reset()
public void setFileStatus(int newStatus)
newStatus
- the new statuspublic int getFileStatus()
public boolean isNew()
public boolean hasUnsavedEdits()
public void setPathname(String newPath)
newPath
- the new pathname. If no directory path, getParent() will return null.public void setPathname(String parent, String name)
parent
- the parent directory of the file. If null, getParent() will return null.name
- the name of the file (no directory path)public String getPathname()
public String getFilename()
public String getParent()
public void updateStaticFileStatus()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |