KickJava   Java API By Example, From Geeks To Geeks.

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


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>IKeyConfiguration</code>.
17  * <p>
18  * This class is not intended to be extended by clients.
19  * </p>
20  *
21  * @since 3.0
22  * @see IKeyConfigurationListener#keyConfigurationChanged(KeyConfigurationEvent)
23  * @deprecated Please use the bindings support in the "org.eclipse.jface"
24  * plug-in instead.
25  * @see org.eclipse.jface.bindings.SchemeEvent
26  */

27 public final class KeyConfigurationEvent {
28
29     /**
30      * whether the key configuration has become or active or inactive.
31      */

32     private final boolean activeChanged;
33
34     /**
35      * Whether the key configuration has become defined or undefined.
36      */

37     private final boolean definedChanged;
38
39     /**
40      * The key configuration that has changed; this value is never
41      * <code>null</code>.
42      */

43     private final IKeyConfiguration keyConfiguration;
44
45     /**
46      * Whether the name of the key configuration has changed.
47      */

48     private final boolean nameChanged;
49
50     /**
51      * Whether the parent identifier has changed.
52      */

53     private final boolean parentIdChanged;
54
55     /**
56      * Creates a new instance of this class.
57      *
58      * @param keyConfiguration
59      * the instance of the interface that changed.
60      * @param activeChanged
61      * true, iff the active property changed.
62      * @param definedChanged
63      * true, iff the defined property changed.
64      * @param nameChanged
65      * true, iff the name property changed.
66      * @param parentIdChanged
67      * true, iff the parentId property changed.
68      */

69     public KeyConfigurationEvent(IKeyConfiguration keyConfiguration,
70             boolean activeChanged, boolean definedChanged, boolean nameChanged,
71             boolean parentIdChanged) {
72         if (keyConfiguration == null) {
73             throw new NullPointerException JavaDoc();
74         }
75
76         this.keyConfiguration = keyConfiguration;
77         this.activeChanged = activeChanged;
78         this.definedChanged = definedChanged;
79         this.nameChanged = nameChanged;
80         this.parentIdChanged = parentIdChanged;
81     }
82
83     /**
84      * Returns the instance of the interface that changed.
85      *
86      * @return the instance of the interface that changed. Guaranteed not to be
87      * <code>null</code>.
88      */

89     public IKeyConfiguration getKeyConfiguration() {
90         return keyConfiguration;
91     }
92
93     /**
94      * Returns whether or not the active property changed.
95      *
96      * @return true, iff the active property changed.
97      */

98     public boolean hasActiveChanged() {
99         return activeChanged;
100     }
101
102     /**
103      * Returns whether or not the defined property changed.
104      *
105      * @return true, iff the defined property changed.
106      */

107     public boolean hasDefinedChanged() {
108         return definedChanged;
109     }
110
111     /**
112      * Returns whether or not the name property changed.
113      *
114      * @return true, iff the name property changed.
115      */

116     public boolean hasNameChanged() {
117         return nameChanged;
118     }
119
120     /**
121      * Returns whether or not the parentId property changed.
122      *
123      * @return true, iff the parentId property changed.
124      */

125     public boolean hasParentIdChanged() {
126         return parentIdChanged;
127     }
128 }
129
Popular Tags