KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > commands > ICategory


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.commands;
13
14 /**
15  * <p>
16  * A category is a grouping of commands by functional area. For example, in the
17  * Eclipse workbench, "Text Editing" is a category containing various commands
18  * related to text editing. A category's primary functionality is to control the
19  * display of commands to the user. When appropriate, commands displayed to the
20  * user (e.g., keys preference page) will be grouped by category.
21  * </p>
22  * <p>
23  * An instance of <code>ICategory</code> is a handle representing a category
24  * as defined by the extension point <code>org.eclipse.ui.commands</code>.
25  * The identifier of the handle is identifier of the category being represented.
26  * </p>
27  * <p>
28  * An instance of <code>ICategory</code> can be obtained from an instance of
29  * <code>ICommandManager</code> for any identifier, whether or not a category
30  * with that identifier defined in the plugin registry.
31  * </p>
32  * <p>
33  * The handle-based nature of this API allows it to work well with runtime
34  * plugin activation and deactivation, which causes dynamic changes to the
35  * plugin registry, and therefore, potentially, dynamic changes to the set of
36  * category definitions.
37  * </p>
38  * <p>
39  * This interface is not intended to be extended or implemented by clients.
40  * </p>
41  *
42  * @since 3.0
43  * @see ICategoryListener
44  * @see ICommandManager
45  * @see org.eclipse.core.commands.Category
46  * @deprecated Please use the "org.eclipse.core.commands" plug-in instead.
47  */

48 public interface ICategory extends Comparable JavaDoc {
49
50     /**
51      * Registers an instance of <code>ICategoryListener</code> to listen for
52      * changes to attributes of this instance.
53      *
54      * @param categoryListener
55      * the instance of <code>ICategoryListener</code> to register.
56      * Must not be <code>null</code>. If an attempt is made to
57      * register an instance of <code>ICategoryListener</code>
58      * which is already registered with this instance, no operation
59      * is performed.
60      */

61     void addCategoryListener(ICategoryListener categoryListener);
62
63     /**
64      * <p>
65      * Returns the description of the category represented by this handle,
66      * suitable for display to the user.
67      * </p>
68      * <p>
69      * Notification is sent to all registered listeners if this attribute
70      * changes.
71      * </p>
72      *
73      * @return the description of the category represented by this handle.
74      * Guaranteed not to be <code>null</code>.
75      * @throws NotDefinedException
76      * if the category represented by this handle is not defined.
77      */

78     String JavaDoc getDescription() throws NotDefinedException;
79
80     /**
81      * Returns the identifier of this handle.
82      *
83      * @return the identifier of this handle. Guaranteed not to be <code>null</code>.
84      */

85     String JavaDoc getId();
86
87     /**
88      * <p>
89      * Returns the name of the category represented by this handle, suitable
90      * for display to the user.
91      * </p>
92      * <p>
93      * Notification is sent to all registered listeners if this attribute
94      * changes.
95      * </p>
96      *
97      * @return the name of the category represented by this handle. Guaranteed
98      * not to be <code>null</code>.
99      * @throws NotDefinedException
100      * if the category represented by this handle is not defined.
101      */

102     String JavaDoc getName() throws NotDefinedException;
103
104     /**
105      * <p>
106      * Returns whether or not the category represented by this handle is
107      * defined.
108      * </p>
109      * <p>
110      * Notification is sent to all registered listeners if this attribute
111      * changes.
112      * </p>
113      *
114      * @return <code>true</code>, iff the category represented by this
115      * handle is defined.
116      */

117     boolean isDefined();
118
119     /**
120      * Unregisters an instance of <code>ICategoryListener</code> listening
121      * for changes to attributes of this instance.
122      *
123      * @param categoryListener
124      * the instance of <code>ICategoryListener</code> to
125      * unregister. Must not be <code>null</code>. If an attempt
126      * is made to unregister an instance of <code>ICategoryListener</code>
127      * which is not already registered with this instance, no
128      * operation is performed.
129      */

130     void removeCategoryListener(ICategoryListener categoryListener);
131 }
132
Popular Tags