KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > websphere6 > dd > loaders > DDChangeEvent


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.j2ee.websphere6.dd.loaders;
20
21 import org.openide.loaders.DataObject;
22 /**
23  *
24  * @author dlm198383
25  */

26 public class DDChangeEvent extends java.util.EventObject JavaDoc{
27      /** Event fired when new web is added or copied from another location */
28     public static final int WEB_ADDED = 1;
29
30     /** Event fired when web is renamed or moved within one web module */
31     public static final int WEB_CHANGED = 2;
32
33     /** Event fired when web is deleted */
34     public static final int WEB_DELETED = 3; // delete
35

36     /** Event fired when web is moved */
37     public static final int WEB_MOVED = 4;
38     
39     
40      /** Newly set value. Usually current classname of web if it makes sense. */
41     private String JavaDoc newValue;
42     
43     /** Old value. Usually old classname of web if it makes sense. */
44     private String JavaDoc oldValue;
45     
46     /** Event type */
47     private int type;
48     
49     /** placeholder for old depl. descriptor (only for web moves) */
50     private DataObject oldDD;
51     
52     /** Creates new event.
53      *
54      * @param src class name of web
55      * @param type type of change
56      */

57     public DDChangeEvent (Object JavaDoc src, DataObject oldDD, String JavaDoc oldVal, String JavaDoc newVal, int type) {
58         super (src);
59         newValue = newVal;
60         oldValue = oldVal;
61         this.type = type;
62         this.oldDD = oldDD;
63     }
64     
65     /** Creates new event.
66      *
67      * @param src class name of web
68      * @param type type of change
69      */

70     public DDChangeEvent (Object JavaDoc src, String JavaDoc oldVal, String JavaDoc newVal, int type) {
71         this (src, null, oldVal, newVal, type);
72     }
73     
74     public String JavaDoc getNewValue () {
75         return newValue;
76     }
77     
78     public String JavaDoc getOldValue () {
79         return oldValue;
80     }
81     
82     public DataObject getOldDD () {
83         return oldDD;
84     }
85     
86     /** Getter for change type
87      *
88      * @return change type
89      */

90     public int getType () {
91         return type;
92     }
93     
94     public String JavaDoc toString () {
95         return "DDChangeEvent "+getSource ()+" of type "+type; // NOI18N
96
}
97     
98 }
99
Popular Tags