001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package travelcenter;
043:
044: import com.sun.rave.web.ui.appbase.AbstractFragmentBean;
045: import com.sun.webui.jsf.component.ImageComponent;
046: import com.sun.webui.jsf.component.ImageHyperlink;
047: import com.sun.webui.jsf.component.PanelLayout;
048: import com.sun.webui.jsf.component.StaticText;
049: import javax.faces.FacesException;
050: import javax.faces.component.html.HtmlPanelGrid;
051:
052: /**
053: * <p>Fragment bean that corresponds to a similarly named JSP page
054: * fragment. This class contains component definitions (and initialization
055: * code) for all components that you have defined on this fragment, as well as
056: * lifecycle methods and event handlers where you may add behavior
057: * to respond to incoming events.</p>
058: */
059: public class Header extends AbstractFragmentBean {
060: // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
061: private int __placeholder;
062:
063: /**
064: * <p>Automatically managed component initialization. <strong>WARNING:</strong>
065: * This method is automatically generated, so any user-specified code inserted
066: * here is subject to being replaced.</p>
067: */
068: private void _init() throws Exception {
069: }
070:
071: private ImageComponent image1 = new ImageComponent();
072:
073: public ImageComponent getImage1() {
074: return image1;
075: }
076:
077: public void setImage1(ImageComponent ic) {
078: this .image1 = ic;
079: }
080:
081: private HtmlPanelGrid bottomPanel = new HtmlPanelGrid();
082:
083: public HtmlPanelGrid getBottomPanel() {
084: return bottomPanel;
085: }
086:
087: public void setBottomPanel(HtmlPanelGrid hpg) {
088: this .bottomPanel = hpg;
089: }
090:
091: private ImageHyperlink home = new ImageHyperlink();
092:
093: public ImageHyperlink getHome() {
094: return home;
095: }
096:
097: public void setHome(ImageHyperlink ih) {
098: this .home = ih;
099: }
100:
101: private ImageHyperlink help = new ImageHyperlink();
102:
103: public ImageHyperlink getHelp() {
104: return help;
105: }
106:
107: public void setHelp(ImageHyperlink ih) {
108: this .help = ih;
109: }
110:
111: private PanelLayout leftPanel = new PanelLayout();
112:
113: public PanelLayout getLeftPanel() {
114: return leftPanel;
115: }
116:
117: public void setLeftPanel(PanelLayout pl) {
118: this .leftPanel = pl;
119: }
120:
121: private StaticText poweredBy = new StaticText();
122:
123: public StaticText getPoweredBy() {
124: return poweredBy;
125: }
126:
127: public void setPoweredBy(StaticText st) {
128: this .poweredBy = st;
129: }
130:
131: // </editor-fold>
132:
133: public Header() {
134: }
135:
136: /**
137: * <p>Callback method that is called whenever a page containing
138: * this page fragment is navigated to, either directly via a URL,
139: * or indirectly via page navigation. Override this method to acquire
140: * resources that will be needed for event handlers and lifecycle methods.</p>
141: *
142: * <p>The default implementation does nothing.</p>
143: */
144: public void init() {
145: // Perform initializations inherited from our superclass
146: super .init();
147: // Perform application initialization that must complete
148: // *before* managed components are initialized
149: // TODO - add your own initialiation code here
150:
151: // <editor-fold defaultstate="collapsed" desc="Visual-Web-managed Component Initialization">
152: // Initialize automatically managed components
153: // *Note* - this logic should NOT be modified
154: try {
155: _init();
156: } catch (Exception e) {
157: log("Page1 Initialization Failure", e);
158: throw e instanceof FacesException ? (FacesException) e
159: : new FacesException(e);
160: }
161:
162: // </editor-fold>
163: // Perform application initialization that must complete
164: // *after* managed components are initialized
165: // TODO - add your own initialization code here
166: }
167:
168: /**
169: * <p>Callback method that is called after rendering is completed for
170: * this request, if <code>init()</code> was called. Override this
171: * method to release resources acquired in the <code>init()</code>
172: * resources that will be needed for event handlers and lifecycle methods.</p>
173: *
174: * <p>The default implementation does nothing.</p>
175: */
176: public void destroy() {
177: }
178:
179: /**
180: * <p>Return a reference to the scoped data bean.</p>
181: */
182: protected SessionBean1 getSessionBean1() {
183: return (SessionBean1) getBean("SessionBean1");
184: }
185:
186: /**
187: * <p>Return a reference to the scoped data bean.</p>
188: */
189: protected RequestBean1 getRequestBean1() {
190: return (RequestBean1) getBean("RequestBean1");
191: }
192:
193: /**
194: * <p>Return a reference to the scoped data bean.</p>
195: */
196: protected ApplicationBean1 getApplicationBean1() {
197: return (ApplicationBean1) getBean("ApplicationBean1");
198: }
199:
200: public String home_action() {
201: // TODO: Process the action. Return value is a navigation
202: // case name where null will return to the same page.
203: return null;
204: }
205:
206: public String help_action() {
207: // TODO: Process the action. Return value is a navigation
208: // case name where null will return to the same page.
209: return null;
210: }
211: }
|