01: /*
02: * Copyright 2006-2007 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt.
07: *
08: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
09: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
10: * the license for the specific language governing your rights and limitations.
11: *
12: * Additional Contributor(s): Martin Schmid gridvision engineering GmbH
13: */
14: package org.pentaho.reportdesigner.lib.client.commands;
15:
16: import org.jetbrains.annotations.NotNull;
17:
18: import java.util.HashMap;
19:
20: /**
21: * User: Martin
22: * Date: 23.11.2004
23: * Time: 19:34:44
24: */
25: public class ApplicationCommandRegistry {
26: @NotNull
27: private Long applicationId;
28:
29: @NotNull
30: private HashMap<String, DefaultCommandGroup> placesCommandGroups;
31:
32: public ApplicationCommandRegistry(@NotNull
33: Long applicationId) {
34: this .applicationId = applicationId;
35:
36: placesCommandGroups = new HashMap<String, DefaultCommandGroup>();
37: }
38:
39: @NotNull
40: public DefaultCommandGroup getDefaultCommandGroup(@NotNull
41: String place) {
42: DefaultCommandGroup defaultCommandGroup = placesCommandGroups
43: .get(place);
44: if (defaultCommandGroup == null) {
45: defaultCommandGroup = new DefaultCommandGroup(
46: "DefaultCommandGroup");//NON-NLS
47: placesCommandGroups.put(place, defaultCommandGroup);
48: }
49:
50: return defaultCommandGroup;
51: }
52:
53: @NotNull
54: public Long getApplicationId() {
55: return applicationId;
56: }
57:
58: public void registerDefaultCommandGroup(@NotNull
59: String place, @NotNull
60: DefaultCommandGroup defaultCommandGroup) {
61: placesCommandGroups.put(place, defaultCommandGroup);
62: }
63: }
|