01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.commands;
11:
12: /**
13: * An instance of this class describes changes to an instance of
14: * <code>ICategory</code>.
15: * <p>
16: * This class is not intended to be extended by clients.
17: * </p>
18: *
19: * @since 3.0
20: * @see org.eclipse.ui.commands.ICategoryListener#categoryChanged(CategoryEvent)
21: * @deprecated Please use the "org.eclipse.core.commands" plug-in instead.
22: * @see org.eclipse.core.commands.CategoryEvent
23: */
24: public final class CategoryEvent {
25:
26: /**
27: * The category that has changed; this value is never <code>null</code>.
28: */
29: private final ICategory category;
30:
31: /**
32: * Whether the defined state of the category has changed.
33: */
34: private final boolean definedChanged;
35:
36: /**
37: * Whether the name of the category has changed.
38: */
39: private final boolean nameChanged;
40:
41: /**
42: * Creates a new instance of this class.
43: *
44: * @param category
45: * the instance of the interface that changed.
46: * @param definedChanged
47: * true, iff the defined property changed.
48: * @param nameChanged
49: * true, iff the name property changed.
50: */
51: public CategoryEvent(ICategory category, boolean definedChanged,
52: boolean nameChanged) {
53: if (category == null) {
54: throw new NullPointerException();
55: }
56:
57: this .category = category;
58: this .definedChanged = definedChanged;
59: this .nameChanged = nameChanged;
60: }
61:
62: /**
63: * Returns the instance of the interface that changed.
64: *
65: * @return the instance of the interface that changed. Guaranteed not to be
66: * <code>null</code>.
67: */
68: public ICategory getCategory() {
69: return category;
70: }
71:
72: /**
73: * Returns whether or not the defined property changed.
74: *
75: * @return true, iff the defined property changed.
76: */
77: public boolean hasDefinedChanged() {
78: return definedChanged;
79: }
80:
81: /**
82: * Returns whether or not the name property changed.
83: *
84: * @return true, iff the name property changed.
85: */
86: public boolean hasNameChanged() {
87: return nameChanged;
88: }
89: }
|