KickJava   Java API By Example, From Geeks To Geeks.

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


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.commands;
13
14 /**
15  * An instance of this class describes changes to an instance of
16  * <code>ICategory</code>.
17  * <p>
18  * This class is not intended to be extended by clients.
19  * </p>
20  *
21  * @since 3.0
22  * @see org.eclipse.ui.commands.ICategoryListener#categoryChanged(CategoryEvent)
23  * @deprecated Please use the "org.eclipse.core.commands" plug-in instead.
24  * @see org.eclipse.core.commands.CategoryEvent
25  */

26 public final class CategoryEvent {
27
28     /**
29      * The category that has changed; this value is never <code>null</code>.
30      */

31     private final ICategory category;
32
33     /**
34      * Whether the defined state of the category has changed.
35      */

36     private final boolean definedChanged;
37
38     /**
39      * Whether the name of the category has changed.
40      */

41     private final boolean nameChanged;
42
43     /**
44      * Creates a new instance of this class.
45      *
46      * @param category
47      * the instance of the interface that changed.
48      * @param definedChanged
49      * true, iff the defined property changed.
50      * @param nameChanged
51      * true, iff the name property changed.
52      */

53     public CategoryEvent(ICategory category, boolean definedChanged,
54             boolean nameChanged) {
55         if (category == null) {
56             throw new NullPointerException JavaDoc();
57         }
58
59         this.category = category;
60         this.definedChanged = definedChanged;
61         this.nameChanged = nameChanged;
62     }
63
64     /**
65      * Returns the instance of the interface that changed.
66      *
67      * @return the instance of the interface that changed. Guaranteed not to be
68      * <code>null</code>.
69      */

70     public ICategory getCategory() {
71         return category;
72     }
73
74     /**
75      * Returns whether or not the defined property changed.
76      *
77      * @return true, iff the defined property changed.
78      */

79     public boolean hasDefinedChanged() {
80         return definedChanged;
81     }
82
83     /**
84      * Returns whether or not the name property changed.
85      *
86      * @return true, iff the name property changed.
87      */

88     public boolean hasNameChanged() {
89         return nameChanged;
90     }
91 }
92
Popular Tags