01: /*
02: * Wilos Is a cLever process Orchestration Software - http://www.wilos-project.org
03: * Copyright (C) 2007 Mickaël CLAVREUL <mclavreul@wilos-project.org>
04: *
05: * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
06: * General Public License as published by the Free Software Foundation; either version 2 of the License,
07: * or (at your option) any later version.
08: *
09: * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
10: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11: * GNU General Public License for more details.
12: *
13: * You should have received a copy of the GNU General Public License along with this program; if not,
14: * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15: */
16:
17: package wilos.presentation.web.project;
18:
19: import wilos.presentation.web.tree.TreeBean;
20: import wilos.presentation.web.utils.WebCommonService;
21:
22: import com.icesoft.faces.component.paneltabset.TabChangeEvent;
23: import com.icesoft.faces.component.paneltabset.TabChangeListener;
24:
25: public class ProjectViewerTabChangeListener implements
26: TabChangeListener {
27:
28: private int currentTabIndex = 0;
29:
30: /**
31: * TabChange Listener for Project main tab set
32: *
33: * @param TabChangeEvent _tabChangeEvent
34: */
35: public void processTabChange(TabChangeEvent _tabChangeEvent) {
36:
37: this .currentTabIndex = _tabChangeEvent.getNewTabIndex();
38: TreeBean treeBean = (TreeBean) WebCommonService
39: .getBean("TreeBean");
40:
41: switch (this .currentTabIndex) {
42: // roles instanciation tab
43: case 1:
44: treeBean.setSelectedMode(TreeBean.ROLES_MODE);
45: treeBean.refreshProjectTree();
46: break;
47: // dependencies management tab
48: case 2:
49: treeBean.setSelectedMode(TreeBean.WORKPRODUCTS_MODE);
50: treeBean.refreshProjectTree();
51: break;
52: default:
53: treeBean.setSelectedMode(TreeBean.TASKS_MODE);
54: treeBean.refreshProjectTree();
55: break;
56: }
57: }
58:
59: /**
60: * getter of currentTabIndex int attribute
61: *
62: * @return the currentTabIndex
63: */
64: public int getCurrentTabIndex() {
65: return this .currentTabIndex;
66: }
67:
68: /**
69: * setter of currentTabIndex int attribute
70: *
71: * @param _currentTabIndex the currentTabIndex to set
72: */
73: public void setCurrentTabIndex(int _currentTabIndex) {
74: this.currentTabIndex = _currentTabIndex;
75: }
76: }
|