KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > activities > ActivityEvent


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.ui.activities;
13
14 /**
15  * An instance of this class describes changes to an instance of
16  * <code>IActivity</code>. This class does not give details as to the
17  * specifics of a change, only that the given property on the source object has
18  * changed.
19  * <p>
20  * This class is not intended to be extended by clients.
21  * </p>
22  *
23  * @since 3.0
24  * @see IActivityListener#activityChanged(ActivityEvent)
25  */

26 public final class ActivityEvent {
27     private IActivity activity;
28
29     private boolean activityRequirementBindingsChanged;
30
31     private boolean activityPatternBindingsChanged;
32
33     private boolean definedChanged;
34
35     private boolean enabledChanged;
36     
37     private boolean defaultEnabledChanged;
38
39     private boolean nameChanged;
40
41     private boolean descriptionChanged;
42
43     /**
44      * Creates a new instance of this class. Since 3.1 this method will assume
45      * that the default enabled state has not changed.
46      *
47      * @param activity
48      * the instance of the interface that changed.
49      * @param activityRequirementBindingsChanged
50      * <code>true</code>, iff the activityRequirementBindings
51      * property changed.
52      * @param activityPatternBindingsChanged
53      * <code>true</code>, iff the activityPatternBindings property
54      * changed.
55      * @param definedChanged
56      * <code>true</code>, iff the defined property changed.
57      * @param descriptionChanged
58      * <code>true</code>, iff the description property changed.
59      * @param enabledChanged
60      * <code>true</code>, iff the enabled property changed.
61      * @param nameChanged
62      * <code>true</code>, iff the name property changed.
63      */

64     public ActivityEvent(IActivity activity,
65             boolean activityRequirementBindingsChanged,
66             boolean activityPatternBindingsChanged, boolean definedChanged,
67             boolean descriptionChanged, boolean enabledChanged,
68             boolean nameChanged) {
69         
70         this(activity,
71                 activityRequirementBindingsChanged,
72                 activityPatternBindingsChanged,
73                 definedChanged,
74                 descriptionChanged,
75                 enabledChanged,
76                 nameChanged,
77                 false);
78     }
79
80     /**
81      * Creates a new instance of this class.
82      *
83      * @param activity
84      * the instance of the interface that changed.
85      * @param activityRequirementBindingsChanged
86      * <code>true</code>, iff the activityRequirementBindings property changed.
87      * @param activityPatternBindingsChanged
88      * <code>true</code>, iff the activityPatternBindings property changed.
89      * @param definedChanged
90      * <code>true</code>, iff the defined property changed.
91      * @param descriptionChanged
92      * <code>true</code>, iff the description property changed.
93      * @param enabledChanged
94      * <code>true</code>, iff the enabled property changed.
95      * @param nameChanged
96      * <code>true</code>, iff the name property changed.
97      * @param defaultEnabledChanged
98      * <code>true</code>, iff the default enabled property changed.
99      * @since 3.1
100      */

101     public ActivityEvent(IActivity activity,
102             boolean activityRequirementBindingsChanged,
103             boolean activityPatternBindingsChanged, boolean definedChanged,
104             boolean descriptionChanged, boolean enabledChanged,
105             boolean nameChanged,
106             boolean defaultEnabledChanged) {
107         if (activity == null) {
108             throw new NullPointerException JavaDoc();
109         }
110
111         this.activity = activity;
112         this.activityRequirementBindingsChanged = activityRequirementBindingsChanged;
113         this.activityPatternBindingsChanged = activityPatternBindingsChanged;
114         this.definedChanged = definedChanged;
115         this.enabledChanged = enabledChanged;
116         this.nameChanged = nameChanged;
117         this.descriptionChanged = descriptionChanged;
118         this.defaultEnabledChanged = defaultEnabledChanged;
119     }
120
121     
122     /**
123      * Returns the instance of the interface that changed.
124      *
125      * @return the instance of the interface that changed. Guaranteed not to be
126      * <code>null</code>.
127      */

128     public IActivity getActivity() {
129         return activity;
130     }
131
132     /**
133      * Returns whether or not the defined property changed.
134      *
135      * @return <code>true</code>, iff the defined property changed.
136      */

137     public boolean hasDefinedChanged() {
138         return definedChanged;
139     }
140
141     /**
142      * Returns whether or not the enabled property changed.
143      *
144      * @return <code>true</code>, iff the enabled property changed.
145      */

146     public boolean hasEnabledChanged() {
147         return enabledChanged;
148     }
149     
150     /**
151      * Returns whether or not the default enabled property changed.
152      *
153      * @return <code>true</code>, iff the default enabled property changed.
154      * @since 3.1
155      */

156     public boolean hasDefaultEnabledChanged() {
157         return defaultEnabledChanged;
158     }
159
160     /**
161      * Returns whether or not the name property changed.
162      *
163      * @return <code>true</code>, iff the name property changed.
164      */

165     public boolean hasNameChanged() {
166         return nameChanged;
167     }
168
169     /**
170      * Returns whether or not the description property changed.
171      *
172      * @return <code>true</code>, iff the description property changed.
173      */

174     public boolean hasDescriptionChanged() {
175         return descriptionChanged;
176     }
177
178     /**
179      * Returns whether or not the activityRequirementBindings property changed.
180      *
181      * @return <code>true</code>, iff the activityRequirementBindings property changed.
182      */

183     public boolean haveActivityRequirementBindingsChanged() {
184         return activityRequirementBindingsChanged;
185     }
186
187     /**
188      * Returns whether or not the activityPatternBindings property changed.
189      *
190      * @return <code>true</code>, iff the activityPatternBindings property changed.
191      */

192     public boolean haveActivityPatternBindingsChanged() {
193         return activityPatternBindingsChanged;
194     }
195 }
196
Popular Tags