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 ReportIncident 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 Label label2 = new Label();
212:
213: public Label getLabel2() {
214: return label2;
215: }
216:
217: public void setLabel2(Label l) {
218: this .label2 = l;
219: }
220:
221: private Label label3 = new Label();
222:
223: public Label getLabel3() {
224: return label3;
225: }
226:
227: public void setLabel3(Label l) {
228: this .label3 = l;
229: }
230:
231: private Label label4 = new Label();
232:
233: public Label getLabel4() {
234: return label4;
235: }
236:
237: public void setLabel4(Label l) {
238: this .label4 = l;
239: }
240:
241: private Label label5 = new Label();
242:
243: public Label getLabel5() {
244: return label5;
245: }
246:
247: public void setLabel5(Label l) {
248: this .label5 = l;
249: }
250:
251: private Button reportButton = new Button();
252:
253: public Button getReportButton() {
254: return reportButton;
255: }
256:
257: public void setReportButton(Button b) {
258: this .reportButton = b;
259: }
260:
261: private StaticText state = new StaticText();
262:
263: public StaticText getState() {
264: return state;
265: }
266:
267: public void setState(StaticText st) {
268: this .state = st;
269: }
270:
271: private StaticText licensePlate = new StaticText();
272:
273: public StaticText getLicensePlate() {
274: return licensePlate;
275: }
276:
277: public void setLicensePlate(StaticText st) {
278: this .licensePlate = st;
279: }
280:
281: private StaticText make = new StaticText();
282:
283: public StaticText getMake() {
284: return make;
285: }
286:
287: public void setMake(StaticText st) {
288: this .make = st;
289: }
290:
291: private StaticText model = new StaticText();
292:
293: public StaticText getModel() {
294: return model;
295: }
296:
297: public void setModel(StaticText st) {
298: this .model = st;
299: }
300:
301: private StaticText color = new StaticText();
302:
303: public StaticText getColor() {
304: return color;
305: }
306:
307: public void setColor(StaticText st) {
308: this .color = st;
309: }
310:
311: private TextArea incident = new TextArea();
312:
313: public TextArea getIncident() {
314: return incident;
315: }
316:
317: public void setIncident(TextArea ta) {
318: this .incident = ta;
319: }
320:
321: private Label label6 = new Label();
322:
323: public Label getLabel6() {
324: return label6;
325: }
326:
327: public void setLabel6(Label l) {
328: this .label6 = l;
329: }
330:
331: private CachedRowSetDataProvider vehicleDataProvider = new CachedRowSetDataProvider();
332:
333: public CachedRowSetDataProvider getVehicleDataProvider() {
334: return vehicleDataProvider;
335: }
336:
337: public void setVehicleDataProvider(CachedRowSetDataProvider crsdp) {
338: this .vehicleDataProvider = crsdp;
339: }
340:
341: // </editor-fold>
342:
343: /**
344: * <p>Construct a new Page bean instance.</p>
345: */
346: public ReportIncident() {
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: @Override
362: public void init() {
363: // Perform initializations inherited from our superclass
364: super .init();
365: // Perform application initialization that must complete
366: // *before* managed components are initialized
367: // TODO - add your own initialiation code here
368:
369: // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
370: // Initialize automatically managed components
371: // *Note* - this logic should NOT be modified
372: try {
373: _init();
374: } catch (Exception e) {
375: log("ReportIncident Initialization Failure", e);
376: throw e instanceof FacesException ? (FacesException) e
377: : new FacesException(e);
378: }
379:
380: // </editor-fold>
381: // Perform application initialization that must complete
382: // *after* managed components are initialized
383: // TODO - add your own initialization code here
384: }
385:
386: /**
387: * <p>Callback method that is called after the component tree has been
388: * restored, but before any event processing takes place. This method
389: * will <strong>only</strong> be called on a postback request that
390: * is processing a form submit. Customize this method to allocate
391: * resources that will be required in your event handlers.</p>
392: */
393: @Override
394: public void preprocess() {
395: }
396:
397: /**
398: * <p>Callback method that is called just before rendering takes place.
399: * This method will <strong>only</strong> be called for the page that
400: * will actually be rendered (and not, for example, on a page that
401: * handled a postback and then navigated to a different page). Customize
402: * this method to allocate resources that will be required for rendering
403: * this page.</p>
404: */
405: @Override
406: public void prerender() {
407: getSessionBean1().setIncident("");
408: }
409:
410: /**
411: * <p>Callback method that is called after rendering is completed for
412: * this request, if <code>init()</code> was called (regardless of whether
413: * or not this was the page that was actually rendered). Customize this
414: * method to release resources acquired in the <code>init()</code>,
415: * <code>preprocess()</code>, or <code>prerender()</code> methods (or
416: * acquired during execution of an event handler).</p>
417: */
418: @Override
419: public void destroy() {
420: vehicleDataProvider.close();
421: }
422:
423: /**
424: * <p>Return a reference to the scoped data bean.</p>
425: */
426: protected ApplicationBean1 getApplicationBean1() {
427: return (ApplicationBean1) getBean("ApplicationBean1");
428: }
429:
430: /**
431: * <p>Return a reference to the scoped data bean.</p>
432: */
433: protected SessionBean1 getSessionBean1() {
434: return (SessionBean1) getBean("SessionBean1");
435: }
436:
437: /**
438: * <p>Return a reference to the scoped data bean.</p>
439: */
440: protected RequestBean1 getRequestBean1() {
441: return (RequestBean1) getBean("RequestBean1");
442: }
443:
444: public String searchButton_action() {
445: // TODO: Process the action. Return value is a navigation
446: // case name where null will return to the same page.
447: return null;
448: }
449:
450: public String reportButton_action() {
451: // TODO: Process the action. Return value is a navigation
452: // case name where null will return to the same page.
453: return "reported";
454: }
455: }
|