Package mars.venus.editor
Enum Class FileStatus
- All Implemented Interfaces:
Serializable
,Comparable<FileStatus>
,Constable
Used to store and return information on the status of the current ASM file that
is being edited in the program.
- Author:
- Team JSpim
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionFile from disk with unsaved edits.Newly created file with unsaved edits.Newly created file with no edits.No files are open (this only applies to the menu state inVenusUI
).File from disk with no edits. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determine whether file has been modified since last save or, if not yet saved, since being created using New or Open.boolean
isNew()
Determine whether file is "new", which means created using New but not yet saved.static FileStatus
Returns the enum constant of this class with the specified name.static FileStatus[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NO_FILE
No files are open (this only applies to the menu state inVenusUI
). -
NEW_NOT_EDITED
Newly created file with no edits. -
NEW_EDITED
Newly created file with unsaved edits. -
NOT_EDITED
File from disk with no edits. -
EDITED
File from disk with unsaved edits.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
isNew
public boolean isNew()Determine whether file is "new", which means created using New but not yet saved. If created using Open, it is not new.- Returns:
- true if file was created using New and has not yet been saved, false otherwise.
-
hasUnsavedEdits
public boolean hasUnsavedEdits()Determine whether file has been modified since last save or, if not yet saved, since being created using New or Open.- Returns:
- true if file has been modified since save or creation, false otherwise.
-