KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > commands > AbstractMutableCommandRegistry


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.ui.internal.commands;
13
14 import java.util.List JavaDoc;
15
16 import org.eclipse.ui.internal.util.Util;
17
18 public abstract class AbstractMutableCommandRegistry
19     extends AbstractCommandRegistry
20     implements IMutableCommandRegistry {
21
22     protected AbstractMutableCommandRegistry() {
23         // Nothing to initialize.
24
}
25
26     public void setActiveKeyConfigurationDefinitions(List JavaDoc activeKeyConfigurationDefinitions) {
27         activeKeyConfigurationDefinitions =
28             Util.safeCopy(
29                 activeKeyConfigurationDefinitions,
30                 ActiveKeyConfigurationDefinition.class);
31
32         if (!activeKeyConfigurationDefinitions
33             .equals(this.activeKeyConfigurationDefinitions)) {
34             this.activeKeyConfigurationDefinitions =
35                 activeKeyConfigurationDefinitions;
36             fireCommandRegistryChanged();
37         }
38     }
39
40     public void setCategoryDefinitions(List JavaDoc categoryDefinitions) {
41         categoryDefinitions =
42             Util.safeCopy(categoryDefinitions, CategoryDefinition.class);
43
44         if (!categoryDefinitions.equals(this.categoryDefinitions)) {
45             this.categoryDefinitions = categoryDefinitions;
46             fireCommandRegistryChanged();
47         }
48     }
49
50     public void setCommandDefinitions(List JavaDoc commandDefinitions) {
51         commandDefinitions =
52             Util.safeCopy(commandDefinitions, CommandDefinition.class);
53
54         if (!commandDefinitions.equals(this.commandDefinitions)) {
55             this.commandDefinitions = commandDefinitions;
56             fireCommandRegistryChanged();
57         }
58     }
59
60     public void setKeyConfigurationDefinitions(List JavaDoc keyConfigurationDefinitions) {
61         commandDefinitions =
62             Util.safeCopy(
63                 keyConfigurationDefinitions,
64                 KeyConfigurationDefinition.class);
65
66         if (!keyConfigurationDefinitions
67             .equals(this.keyConfigurationDefinitions)) {
68             this.keyConfigurationDefinitions = keyConfigurationDefinitions;
69             fireCommandRegistryChanged();
70         }
71     }
72
73     public void setKeySequenceBindingDefinitions(List JavaDoc keySequenceBindingDefinitions) {
74         keySequenceBindingDefinitions =
75             Util.safeCopy(
76                 keySequenceBindingDefinitions,
77                 KeySequenceBindingDefinition.class);
78
79         if (!keySequenceBindingDefinitions
80             .equals(this.keySequenceBindingDefinitions)) {
81             this.keySequenceBindingDefinitions = keySequenceBindingDefinitions;
82             fireCommandRegistryChanged();
83         }
84     }
85 }
86
Popular Tags