KickJava   Java API By Example, From Geeks To Geeks.

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


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 import java.util.Set JavaDoc;
15
16 /**
17  * An instance of this interface can be obtained from an instance of
18  * <code>IActivityManager</code>for any identifier.
19  * <p>
20  * An <code>IIdentifier</code> is an object that offers an easy means to
21  * determine if a given string matches the pattern bindings of any IActivity
22  * objects. Additionaly, one may query if an identifier is enabled. An
23  * identifier is always considered enabled unless it matches only disabled activities.
24  * </p>
25  * <p>
26  * The handle-based nature of this API allows it to work well with runtime
27  * plugin activation and deactivation, which can cause dynamic changes to the
28  * extension registry.
29  * </p>
30  * <p>
31  * This interface is not intended to be extended or implemented by clients.
32  * </p>
33  *
34  * @since 3.0
35  * @see IActivityManager#getIdentifier(String)
36  */

37 public interface IIdentifier extends Comparable JavaDoc {
38
39     /**
40      * Registers an instance of <code>IIdentifierListener</code> to listen
41      * for changes to properties of this instance.
42      *
43      * @param identifierListener
44      * the instance to register. Must not be <code>null</code>.
45      * If an attempt is made to register an instance which is
46      * already registered with this instance, no operation is
47      * performed.
48      */

49     void addIdentifierListener(IIdentifierListener identifierListener);
50
51     /**
52      * Returns the set of activity ids that this instance matches. Each
53      * activity in this set will have at least one pattern binding that matches
54      * the string returned by {@link #getId()}.
55      * <p>
56      * Notification is sent to all registered listeners if this property
57      * changes.
58      * </p>
59      *
60      * @return the set of activity ids that this instance matches. This set may
61      * be empty, but is guaranteed not to be <code>null</code>. If
62      * this set is not empty, it is guaranteed to only contain
63      * instances of <code>String</code>.
64      */

65     Set JavaDoc getActivityIds();
66
67     /**
68      * Returns the identifier of this instance.
69      *
70      * @return the identifier of this instance. Guaranteed not to be <code>null</code>.
71      */

72     String JavaDoc getId();
73
74     /**
75      * Returns whether or not this instance is enabled. An identifier is always
76      * considered enabled unless it matches only disabled activities.
77      *
78      * <p>
79      * Notification is sent to all registered listeners if this property
80      * changes.
81      * </p>
82      *
83      * @return <code>true</code>, iff this instance is enabled.
84      */

85     boolean isEnabled();
86
87     /**
88      * Removes an instance of <code>IIdentifierListener</code> listening
89      * for changes to properties of this instance.
90      *
91      * @param identifierListener
92      * the instance to remove. Must not be <code>null</code>.
93      * If an attempt is made to remove an instance which is not
94      * already registered with this instance, no operation is
95      * performed.
96      */

97     void removeIdentifierListener(IIdentifierListener identifierListener);
98 }
99
Popular Tags