01: package com.salmonllc.examples.example7;
02:
03: //The Salmon Open Framework for Internet Applications (SOFIA)
04: //Copyright (C) 1999 - 2002, Salmon LLC
05: //
06: //This program is free software; you can redistribute it and/or
07: //modify it under the terms of the GNU General Public License version 2
08: //as published by the Free Software Foundation;
09: //
10: //This program is distributed in the hope that it will be useful,
11: //but WITHOUT ANY WARRANTY; without even the implied warranty of
12: //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13: //GNU General Public License for more details.
14: //
15: //You should have received a copy of the GNU General Public License
16: //along with this program; if not, write to the Free Software
17: //Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18: //
19: //For more information please visit http://www.salmonllc.com
20:
21: import com.salmonllc.jsp.*;
22: import com.salmonllc.html.events.*;
23:
24: /**
25: * The controller for a navigation bar page. All it does is delagate the population of the navigation bar to a model component.
26: */
27: public class NavigationBarController extends JspController implements
28: ValueChangedListener {
29:
30: public com.salmonllc.html.HtmlText _heading;
31: public com.salmonllc.html.HtmlText _returnToHomePageText;
32: public com.salmonllc.html.HtmlText _sourceList;
33: public com.salmonllc.html.HtmlText _title;
34: public com.salmonllc.jsp.JspNavBar _navbar1;
35: public com.salmonllc.html.HtmlCheckBox _checkbox1;
36:
37: public void initialize() throws Exception {
38: ExamplesModel m = new ExamplesModel(getApplicationName());
39: m.populateNavBar(_navbar1, 1);
40: _checkbox1.addValueChangedListener(this );
41: }
42:
43: public boolean valueChanged(ValueChangedEvent e) throws Exception {
44:
45: if (_navbar1.isHorizontalMode()) {
46: _navbar1.setGroupTitle("examplesNav", "Examples");
47: _navbar1.setHorizontalMode(false);
48: } else {
49: _navbar1.setGroupTitle("examplesNav", null);
50: _navbar1.setHorizontalMode(true);
51: }
52:
53: return false;
54: }
55:
56: }
|