01: // ResourceActionEvent.java
02: // $Id: ResourceActionEvent.java,v 1.7 2000/08/16 21:37:31 ylafon Exp $
03: // (c) COPYRIGHT MIT, INRIA and Keio, 1999.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05: package org.w3c.jigadmin.events;
06:
07: import java.util.EventObject;
08:
09: /**
10: * ActionEvent dedicated to Resource.
11: * @version $Revision: 1.7 $
12: * @author Benoît Mahé (bmahe@w3.org)
13: */
14: public class ResourceActionEvent extends EventObject {
15:
16: public final static int DELETE_EVENT = 10;
17: public final static int ADD_EVENT = 20;
18: public final static int REINDEX_EVENT = 30;
19: public final static int SAVE_EVENT = 40;
20: public final static int STOP_EVENT = 50;
21: public final static int REFERENCE_EVENT = 60;
22: public final static int EDIT_EVENT = 70;
23:
24: private int command = -1;
25:
26: public ResourceActionEvent(Object source, int command) {
27: super (source);
28: this .command = command;
29: }
30:
31: public int getResourceActionCommand() {
32: return command;
33: }
34:
35: public String toString() {
36: switch (command) {
37: case DELETE_EVENT:
38: return "DELETE RESOURCES";
39: case REFERENCE_EVENT:
40: return "SHOW REFERENCE DOCUMENTATION";
41: case REINDEX_EVENT:
42: return "REINDEX RESOURCES";
43: case SAVE_EVENT:
44: return "SAVE RESOURCES";
45: case STOP_EVENT:
46: return "STOP SERVER";
47: case ADD_EVENT:
48: return "ADD RESOURCE";
49: case EDIT_EVENT:
50: return "EDIT RESOURCE";
51: default:
52: return "UKNOWN";
53: }
54: }
55:
56: }
|