01: /*
02: * This program is free software; you can redistribute it and/or
03: * modify it under the terms of the GNU General Public License
04: * as published by the Free Software Foundation; either version 2
05: * of the License, or any later version.
06: *
07: * This program is distributed in the hope that it will be useful,
08: * but WITHOUT ANY WARRANTY; without even the implied warranty of
09: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10: * GNU General Public License for more detaProjectTreeSelectionListenerils.
11: *
12: * You should have received a copy of the GNU General Public License
13: * along with this program; if not, write to the Free Software
14: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15: */
16: package org.acm.seguin.ide.jedit.event;
17:
18: import java.util.EventObject;
19:
20: import org.acm.seguin.ide.jedit.JRefactory;
21: import org.acm.seguin.ide.jedit.UMLProject;
22:
23: /**
24: * A project viewer event.
25: *
26: *@author <a href="mailto:JRefactoryPlugin@ladyshot.demon.co.uk">Mike
27: * Atkinson</a>
28: *@created 23 July 2003
29: *@version $Id: JRefactoryEvent.java,v 1.1 2003/09/17 19:52:50 mikeatkinson Exp $
30: *@since 0.0.1
31: */
32: public final class JRefactoryEvent extends EventObject {
33:
34: private UMLProject project;
35: private JRefactory viewer;
36:
37: /**
38: * Create a new <code>JRefactoryEvent</code>.
39: *
40: *@param src the project viewer instance that fired the event.
41: *@param prj the project loaded (null if "All Projects").
42: */
43: public JRefactoryEvent(JRefactory src, UMLProject prj) {
44: this (src, src, prj);
45: }
46:
47: /**
48: * Create a new <code>JRefactoryEvent</code>.
49: *
50: *@param src the project viewer instance that fired the event.
51: *@param prj the project loaded (null if "All Projects").
52: */
53: public JRefactoryEvent(Object src, UMLProject prj) {
54: this (src,
55: (src instanceof JRefactory) ? (JRefactory) src : null,
56: prj);
57: }
58:
59: /**
60: * Create a new <code>JRefactoryEvent</code>.
61: *
62: *@param src the project viewer instance that fired the event.
63: *@param viewer Description of the Parameter
64: *@param prj the project loaded (null if "All Projects").
65: */
66: public JRefactoryEvent(Object src, JRefactory viewer, UMLProject prj) {
67: super (src);
68: this .viewer = viewer;
69: project = prj;
70: }
71:
72: /**
73: * Returns the {@link JRefactory}.
74: *
75: *@return The viewer where the event occurred.
76: */
77: public JRefactory getJRefactory() {
78: return viewer;
79: }
80:
81: /**
82: * Returns the {@link UMLProject Project}. It is important to noticed that
83: * this value can be <code>null</code>, which means that the "All Projects"
84: * mode has been activated.
85: *
86: *@return The activated project, or null if "All Projects" was chosen.
87: */
88: public UMLProject getProject() {
89: return project;
90: }
91:
92: }
|