01: /**
02: * L2FProd.com Common Components 7.3 License.
03: *
04: * Copyright 2005-2007 L2FProd.com
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */package com.l2fprod.common.springrcp;
18:
19: import org.springframework.richclient.command.ActionCommand;
20: import org.springframework.richclient.command.CommandGroup;
21: import org.springframework.richclient.command.CommandGroupFactoryBean;
22: import org.springframework.richclient.command.CommandRegistry;
23:
24: public class JTaskPaneGroupFactoryBean extends CommandGroupFactoryBean {
25:
26: private String groupId;
27: private Object[] encodedMembers;
28: private boolean expanded = true;
29: private boolean special = false;
30: private boolean scrollOnExpand = false;
31: private boolean animated = true;
32:
33: private CommandRegistry registry;
34:
35: public void setBeanName(String beanName) {
36: this .groupId = beanName;
37: }
38:
39: public void setMembers(Object[] members) {
40: this .encodedMembers = members;
41: }
42:
43: public void setExpanded(boolean expanded) {
44: this .expanded = expanded;
45: }
46:
47: public void setAnimated(boolean animated) {
48: this .animated = animated;
49: }
50:
51: public void setScrollOnExpand(boolean scrollOnExpand) {
52: this .scrollOnExpand = scrollOnExpand;
53: }
54:
55: public void setSpecial(boolean special) {
56: this .special = special;
57: }
58:
59: public void setCommandRegistry(CommandRegistry registry) {
60: this .registry = registry;
61: }
62:
63: protected CommandGroup createCommandGroup() {
64: JTaskPaneGroupCommandGroup group = new JTaskPaneGroupCommandGroup(
65: groupId, registry);
66: group.setExpanded(expanded);
67: group.setAnimated(animated);
68: group.setScrollOnExpand(scrollOnExpand);
69: group.setSpecial(special);
70: if (encodedMembers != null) {
71: for (int i = 0; i < encodedMembers.length; i++) {
72: String actionName = (String) encodedMembers[i];
73: ActionCommand childAction = registry
74: .getActionCommand(actionName);
75: group.addActionCommand(childAction);
76: }
77: }
78: return group;
79: }
80:
81: }
|