KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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 import java.util.Set JavaDoc;
15
16 /**
17  * An instance of this interface is an activity as defined by the extension
18  * point <code>org.eclipse.ui.activities</code>.
19  *
20  * <p>
21  * An instance of this interface can be obtained from an instance of
22  * <code>IActivityManager</code> for any identifier, whether or not an activity
23  * with that identifier is defined in the extension registry.
24  * </p>
25  *
26  * <p>
27  * The handle-based nature of this API allows it to work well with runtime
28  * plugin activation and deactivation, which can cause dynamic changes to the
29  * extension registry. A client may get an <code>IActivity</code> handle that
30  * is currently undefined ({@link #isDefined()} equals <code>false</code>) and
31  * listen for it to become defined.
32  * </p>
33  *
34  * <p>
35  * This interface is not intended to be extended or implemented by clients.
36  * </p>
37  *
38  * @since 3.0
39  * @see IActivityManager
40  */

41 public interface IActivity extends Comparable JavaDoc {
42
43     /**
44      * Registers an instance of <code>IActivityListener</code> to listen for
45      * changes to properties of this instance.
46      *
47      * @param activityListener
48      * the instance to register. Must not be <code>null</code>.
49      * If an attempt is made to register an instance which is
50      * already registered with this instance, no operation is
51      * performed.
52      */

53     void addActivityListener(IActivityListener activityListener);
54
55     /**
56      * Returns the set of activity requirement bindings for this instance.
57      * <p>
58      * This method will return all activity requirement bindings for this
59      * instance, whether or not this instance is defined.
60      * </p>
61      * <p>
62      * Notification is sent to all registered listeners if this property
63      * changes.
64      * </p>
65      *
66      * @return the set of activity requirement bindings. This set may be empty,
67      * but is guaranteed not to be <code>null</code>. If this set is
68      * not empty, it is guaranteed to only contain instances of
69      * <code>IActivityRequirementBinding</code>.
70      * @see IActivityRequirementBinding
71      */

72     Set JavaDoc getActivityRequirementBindings();
73
74     /**
75      * Returns the set of activity pattern bindings for this instance.
76      * <p>
77      * This method will return all activity pattern bindings for this instance,
78      * whether or not this instance is defined.
79      * </p>
80      * <p>
81      * Notification is sent to all registered listeners if this property
82      * changes.
83      * </p>
84      *
85      * @return the set of activity pattern bindings. This set may be empty, but
86      * is guaranteed not to be <code>null</code>. If this set is not
87      * empty, it is guaranteed to only contain instances of <code>IActivityPatternBinding</code>.
88      * @see IActivityPatternBinding
89      */

90     Set JavaDoc getActivityPatternBindings();
91
92     /**
93      * Returns the identifier of this instance.
94      *
95      * @return the identifier of this instance. Guaranteed not to be <code>null</code>.
96      */

97     String JavaDoc getId();
98
99     /**
100      * Returns the name of this instance suitable for display to the user.
101      * <p>
102      * Notification is sent to all registered listeners if this property
103      * changes.
104      * </p>
105      *
106      * @return the name of this instance. Guaranteed not to be <code>null</code>.
107      * @throws NotDefinedException
108      * if this instance is not defined.
109      */

110     String JavaDoc getName() throws NotDefinedException;
111
112     /**
113      * Returns the description of this instance suitable for display to the user.
114      * <p>
115      * Notification is sent to all registered listeners if this property
116      * changes.
117      * </p>
118      *
119      * @return the description of this instance. Guaranteed not to be <code>null</code>.
120      * @throws NotDefinedException
121      * if this instance is not defined.
122      */

123     String JavaDoc getDescription() throws NotDefinedException;
124
125     /**
126      * Returns whether or not this instance is defined. A defined activity
127      * may have a name, description and bindings (both pattern and relational).
128      * <p>
129      * Notification is sent to all registered listeners if this property
130      * changes.
131      * </p>
132      *
133      * @return <code>true</code>, iff this instance is defined.
134      */

135     boolean isDefined();
136
137     /**
138      * Returns whether or not this instance is enabled.
139      * <p>
140      * Notification is sent to all registered listeners if this property
141      * changes.
142      * </p>
143      *
144      * @return <code>true</code>, iff this instance is enabled.
145      */

146     boolean isEnabled();
147     
148     /**
149      * Returns whether or not this instance should be enabled by default.
150      *
151      * @return <code>true</code>, iff this instance should be enabled by default.
152      * @throws NotDefinedException
153      * if this instance is not defined.
154      * @since 3.1
155      */

156     boolean isDefaultEnabled() throws NotDefinedException;
157
158     /**
159      * Removes an instance of <code>IActivityListener</code> listening
160      * for changes to properties of this instance.
161      *
162      * @param activityListener
163      * the instance to remove. Must not be <code>null</code>.
164      * If an attempt is made to remove an instance which is not
165      * already registered with this instance, no operation is
166      * performed.
167      */

168     void removeActivityListener(IActivityListener activityListener);
169 }
170
Popular Tags