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 vehicleincidentreportapplication;
043:
044: import com.sun.data.provider.impl.CachedRowSetDataProvider;
045: import com.sun.rave.web.ui.appbase.AbstractPageBean;
046: import com.sun.webui.jsf.component.Body;
047: import com.sun.webui.jsf.component.Button;
048: import com.sun.webui.jsf.component.Form;
049: import com.sun.webui.jsf.component.Head;
050: import com.sun.webui.jsf.component.Html;
051: import com.sun.webui.jsf.component.Label;
052: import com.sun.webui.jsf.component.Link;
053: import com.sun.webui.jsf.component.MessageGroup;
054: import com.sun.webui.jsf.component.Page;
055: import com.sun.webui.jsf.component.StaticText;
056: import com.sun.webui.jsf.component.TextArea;
057: import javax.faces.FacesException;
058: import javax.faces.component.html.HtmlPanelGrid;
059:
060: /**
061: * <p>Page bean that corresponds to a similarly named JSP page. This
062: * class contains component definitions (and initialization code) for
063: * all components that you have defined on this page, as well as
064: * lifecycle methods and event handlers where you may add behavior
065: * to respond to incoming events.</p>
066: */
067: public class IncidentReported extends AbstractPageBean {
068: // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
069: private int __placeholder;
070:
071: /**
072: * <p>Automatically managed component initialization. <strong>WARNING:</strong>
073: * This method is automatically generated, so any user-specified code inserted
074: * here is subject to being replaced.</p>
075: */
076: private void _init() throws Exception {
077: vehicleDataProvider
078: .setCachedRowSet((javax.sql.rowset.CachedRowSet) getValue("#{SessionBean1.vehicleRowSet}"));
079: }
080:
081: private Page page1 = new Page();
082:
083: public Page getPage1() {
084: return page1;
085: }
086:
087: public void setPage1(Page p) {
088: this .page1 = p;
089: }
090:
091: private Html html1 = new Html();
092:
093: public Html getHtml1() {
094: return html1;
095: }
096:
097: public void setHtml1(Html h) {
098: this .html1 = h;
099: }
100:
101: private Head head1 = new Head();
102:
103: public Head getHead1() {
104: return head1;
105: }
106:
107: public void setHead1(Head h) {
108: this .head1 = h;
109: }
110:
111: private Link link1 = new Link();
112:
113: public Link getLink1() {
114: return link1;
115: }
116:
117: public void setLink1(Link l) {
118: this .link1 = l;
119: }
120:
121: private Body body1 = new Body();
122:
123: public Body getBody1() {
124: return body1;
125: }
126:
127: public void setBody1(Body b) {
128: this .body1 = b;
129: }
130:
131: private Form form1 = new Form();
132:
133: public Form getForm1() {
134: return form1;
135: }
136:
137: public void setForm1(Form f) {
138: this .form1 = f;
139: }
140:
141: private HtmlPanelGrid content = new HtmlPanelGrid();
142:
143: public HtmlPanelGrid getContent() {
144: return content;
145: }
146:
147: public void setContent(HtmlPanelGrid hpg) {
148: this .content = hpg;
149: }
150:
151: private HtmlPanelGrid contentGrid = new HtmlPanelGrid();
152:
153: public HtmlPanelGrid getContentGrid() {
154: return contentGrid;
155: }
156:
157: public void setContentGrid(HtmlPanelGrid hpg) {
158: this .contentGrid = hpg;
159: }
160:
161: private HtmlPanelGrid messagePanel = new HtmlPanelGrid();
162:
163: public HtmlPanelGrid getMessagePanel() {
164: return messagePanel;
165: }
166:
167: public void setMessagePanel(HtmlPanelGrid hpg) {
168: this .messagePanel = hpg;
169: }
170:
171: private MessageGroup messageGroup1 = new MessageGroup();
172:
173: public MessageGroup getMessageGroup1() {
174: return messageGroup1;
175: }
176:
177: public void setMessageGroup1(MessageGroup mg) {
178: this .messageGroup1 = mg;
179: }
180:
181: private HtmlPanelGrid paddingPanel = new HtmlPanelGrid();
182:
183: public HtmlPanelGrid getPaddingPanel() {
184: return paddingPanel;
185: }
186:
187: public void setPaddingPanel(HtmlPanelGrid hpg) {
188: this .paddingPanel = hpg;
189: }
190:
191: private HtmlPanelGrid dataGrid = new HtmlPanelGrid();
192:
193: public HtmlPanelGrid getDataGrid() {
194: return dataGrid;
195: }
196:
197: public void setDataGrid(HtmlPanelGrid hpg) {
198: this .dataGrid = hpg;
199: }
200:
201: private Label label1 = new Label();
202:
203: public Label getLabel1() {
204: return label1;
205: }
206:
207: public void setLabel1(Label l) {
208: this .label1 = l;
209: }
210:
211: private StaticText state = new StaticText();
212:
213: public StaticText getState() {
214: return state;
215: }
216:
217: public void setState(StaticText st) {
218: this .state = st;
219: }
220:
221: private Label label2 = new Label();
222:
223: public Label getLabel2() {
224: return label2;
225: }
226:
227: public void setLabel2(Label l) {
228: this .label2 = l;
229: }
230:
231: private StaticText licensePlate = new StaticText();
232:
233: public StaticText getLicensePlate() {
234: return licensePlate;
235: }
236:
237: public void setLicensePlate(StaticText st) {
238: this .licensePlate = st;
239: }
240:
241: private Label label3 = new Label();
242:
243: public Label getLabel3() {
244: return label3;
245: }
246:
247: public void setLabel3(Label l) {
248: this .label3 = l;
249: }
250:
251: private StaticText make = new StaticText();
252:
253: public StaticText getMake() {
254: return make;
255: }
256:
257: public void setMake(StaticText st) {
258: this .make = st;
259: }
260:
261: private Label label4 = new Label();
262:
263: public Label getLabel4() {
264: return label4;
265: }
266:
267: public void setLabel4(Label l) {
268: this .label4 = l;
269: }
270:
271: private StaticText model = new StaticText();
272:
273: public StaticText getModel() {
274: return model;
275: }
276:
277: public void setModel(StaticText st) {
278: this .model = st;
279: }
280:
281: private Label label5 = new Label();
282:
283: public Label getLabel5() {
284: return label5;
285: }
286:
287: public void setLabel5(Label l) {
288: this .label5 = l;
289: }
290:
291: private StaticText color = new StaticText();
292:
293: public StaticText getColor() {
294: return color;
295: }
296:
297: public void setColor(StaticText st) {
298: this .color = st;
299: }
300:
301: private Label label6 = new Label();
302:
303: public Label getLabel6() {
304: return label6;
305: }
306:
307: public void setLabel6(Label l) {
308: this .label6 = l;
309: }
310:
311: private Button reportButton = new Button();
312:
313: public Button getReportButton() {
314: return reportButton;
315: }
316:
317: public void setReportButton(Button b) {
318: this .reportButton = b;
319: }
320:
321: private CachedRowSetDataProvider vehicleDataProvider = new CachedRowSetDataProvider();
322:
323: public CachedRowSetDataProvider getVehicleDataProvider() {
324: return vehicleDataProvider;
325: }
326:
327: public void setVehicleDataProvider(CachedRowSetDataProvider crsdp) {
328: this .vehicleDataProvider = crsdp;
329: }
330:
331: private StaticText incident = new StaticText();
332:
333: public StaticText getIncident() {
334: return incident;
335: }
336:
337: public void setIncident(StaticText st) {
338: this .incident = st;
339: }
340:
341: // </editor-fold>
342:
343: /**
344: * <p>Construct a new Page bean instance.</p>
345: */
346: public IncidentReported() {
347: }
348:
349: /**
350: * <p>Callback method that is called whenever a page is navigated to,
351: * either directly via a URL, or indirectly via page navigation.
352: * Customize this method to acquire resources that will be needed
353: * for event handlers and lifecycle methods, whether or not this
354: * page is performing post back processing.</p>
355: *
356: * <p>Note that, if the current request is a postback, the property
357: * values of the components do <strong>not</strong> represent any
358: * values submitted with this request. Instead, they represent the
359: * property values that were saved for this view when it was rendered.</p>
360: */
361: public void init() {
362: // Perform initializations inherited from our superclass
363: super .init();
364: // Perform application initialization that must complete
365: // *before* managed components are initialized
366: // TODO - add your own initialiation code here
367:
368: // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
369: // Initialize automatically managed components
370: // *Note* - this logic should NOT be modified
371: try {
372: _init();
373: } catch (Exception e) {
374: log("IncidentReported Initialization Failure", e);
375: throw e instanceof FacesException ? (FacesException) e
376: : new FacesException(e);
377: }
378:
379: // </editor-fold>
380: // Perform application initialization that must complete
381: // *after* managed components are initialized
382: // TODO - add your own initialization code here
383: }
384:
385: /**
386: * <p>Callback method that is called after the component tree has been
387: * restored, but before any event processing takes place. This method
388: * will <strong>only</strong> be called on a postback request that
389: * is processing a form submit. Customize this method to allocate
390: * resources that will be required in your event handlers.</p>
391: */
392: public void preprocess() {
393: }
394:
395: /**
396: * <p>Callback method that is called just before rendering takes place.
397: * This method will <strong>only</strong> be called for the page that
398: * will actually be rendered (and not, for example, on a page that
399: * handled a postback and then navigated to a different page). Customize
400: * this method to allocate resources that will be required for rendering
401: * this page.</p>
402: */
403: public void prerender() {
404: }
405:
406: /**
407: * <p>Callback method that is called after rendering is completed for
408: * this request, if <code>init()</code> was called (regardless of whether
409: * or not this was the page that was actually rendered). Customize this
410: * method to release resources acquired in the <code>init()</code>,
411: * <code>preprocess()</code>, or <code>prerender()</code> methods (or
412: * acquired during execution of an event handler).</p>
413: */
414: public void destroy() {
415: vehicleDataProvider.close();
416: }
417:
418: /**
419: * <p>Return a reference to the scoped data bean.</p>
420: */
421: protected ApplicationBean1 getApplicationBean1() {
422: return (ApplicationBean1) getBean("ApplicationBean1");
423: }
424:
425: /**
426: * <p>Return a reference to the scoped data bean.</p>
427: */
428: protected SessionBean1 getSessionBean1() {
429: return (SessionBean1) getBean("SessionBean1");
430: }
431:
432: /**
433: * <p>Return a reference to the scoped data bean.</p>
434: */
435: protected RequestBean1 getRequestBean1() {
436: return (RequestBean1) getBean("RequestBean1");
437: }
438:
439: public String reportButton_action() {
440: // TODO: Process the action. Return value is a navigation
441: // case name where null will return to the same page.
442: return null;
443: }
444: }
|