Changeset 5990


Ignore:
Timestamp:
2003-11-25T16:18:20+13:00 (20 years ago)
Author:
jmt12
Message:

Added a new attribute to these events, an integer describing the user action which caused them, if any

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/msm/MSMEvent.java

    r5785 r5990  
    6565    /** The value tree model prior to adding a new value. */
    6666    private GValueModel old_model = null;
     67    /** The action initiated by the user which caused this event, if any */
     68    private int action = -1;
    6769    /** A unique id given to any file or metadata task so it can be undone in its entirity. */
    6870    private long id;
     
    102104    }
    103105    /** Constructor for a metadata change event involving a filenode. */
    104     public MSMEvent(Object source, long id, FileNode record, Metadata old_metadata, Metadata new_metadata) {
     106    public MSMEvent(Object source, long id, FileNode record, Metadata old_metadata, Metadata new_metadata, int action) {
    105107    super(source, 0);
     108    this.action = action;
    106109    this.element = null;
    107110    this.id = id;
     
    133136    this.value = value;
    134137    }
     138
     139    /** Retrieve the code of the user action that fired this event.
     140     * @return the action as an int
     141     */
     142    public int getAction() {
     143    return action;
     144    }
     145
    135146    /** Method to retrieve of the element associated with this event.
    136147     * @return A <strong>ElementWrapper</strong>, or <i>null</i> if there is none.
Note: See TracChangeset for help on using the changeset viewer.