KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > commands > common > AbstractHandleObjectEvent


1 /*******************************************************************************
2  * Copyright (c) 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.core.commands.common;
13
14 /**
15  * <p>
16  * An event fired from a <code>NamedHandleObject</code>. This provides
17  * notification of changes to the defined state, the name and the description.
18  * </p>
19  *
20  * @since 3.2
21  */

22 public abstract class AbstractHandleObjectEvent extends AbstractBitSetEvent {
23
24     /**
25      * The bit used to represent whether the category has changed its defined
26      * state.
27      */

28     protected static final int CHANGED_DEFINED = 1;
29
30     /**
31      * The last used bit so that subclasses can add more properties.
32      */

33     protected static final int LAST_BIT_USED_ABSTRACT_HANDLE = CHANGED_DEFINED;
34
35     /**
36      * Constructs a new instance of <code>AbstractHandleObjectEvent</code>.
37      *
38      * @param definedChanged
39      * <code>true</code>, iff the defined property changed.
40      */

41     protected AbstractHandleObjectEvent(final boolean definedChanged) {
42         if (definedChanged) {
43             changedValues |= CHANGED_DEFINED;
44         }
45     }
46
47     /**
48      * Returns whether or not the defined property changed.
49      *
50      * @return <code>true</code>, iff the defined property changed.
51      */

52     public final boolean isDefinedChanged() {
53         return ((changedValues & CHANGED_DEFINED) != 0);
54     }
55 }
56
Popular Tags