KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > nextapp > echo2 > testapp > interactive > WelcomePane


1 /*
2  * This file is part of the Echo Web Application Framework (hereinafter "Echo").
3  * Copyright (C) 2002-2005 NextApp, Inc.
4  *
5  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6  *
7  * The contents of this file are subject to the Mozilla Public License Version
8  * 1.1 (the "License"); you may not use this file except in compliance with
9  * the License. You may obtain a copy of the License at
10  * http://www.mozilla.org/MPL/
11  *
12  * Software distributed under the License is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14  * for the specific language governing rights and limitations under the
15  * License.
16  *
17  * Alternatively, the contents of this file may be used under the terms of
18  * either the GNU General Public License Version 2 or later (the "GPL"), or
19  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
20  * in which case the provisions of the GPL or the LGPL are applicable instead
21  * of those above. If you wish to allow use of your version of this file only
22  * under the terms of either the GPL or the LGPL, and not to allow others to
23  * use your version of this file under the terms of the MPL, indicate your
24  * decision by deleting the provisions above and replace them with the notice
25  * and other provisions required by the GPL or the LGPL. If you do not delete
26  * the provisions above, a recipient may use your version of this file under
27  * the terms of any one of the MPL, the GPL or the LGPL.
28  */

29
30 package nextapp.echo2.testapp.interactive;
31
32 import nextapp.echo2.app.Button;
33 import nextapp.echo2.app.ContentPane;
34 import nextapp.echo2.app.Extent;
35 import nextapp.echo2.app.Font;
36 import nextapp.echo2.app.Insets;
37 import nextapp.echo2.app.Label;
38 import nextapp.echo2.app.Column;
39 import nextapp.echo2.app.Row;
40 import nextapp.echo2.app.SplitPane;
41 import nextapp.echo2.app.WindowPane;
42 import nextapp.echo2.app.event.ActionEvent;
43 import nextapp.echo2.app.event.ActionListener;
44
45 /**
46  * <code>ContentPane</code> which displays a welcome/instruction message to
47  * users when they initially visit the application.
48  */

49 public class WelcomePane extends ContentPane {
50     
51     /**
52      * Default constructor.
53      */

54     public WelcomePane() {
55         super();
56         setStyleName("WelcomePane");
57         setRenderId("WelcomePane");
58         
59         Label label;
60
61         WindowPane loginWindow = new WindowPane();
62         loginWindow.setTitle("Welcome to the NextApp Echo2 Test Application");
63         loginWindow.setStyleName("WelcomePane");
64         loginWindow.setClosable(false);
65         add(loginWindow);
66         
67         SplitPane splitPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL_BOTTOM_TOP, new Extent(32));
68         loginWindow.add(splitPane);
69         
70         Row controlRow = new Row();
71         controlRow.setStyleName("ControlPane");
72         splitPane.add(controlRow);
73         
74         Button button = new Button("Continue", Styles.ICON_24_YES);
75         button.setRenderId("WelcomePaneEnter");
76         button.setId("EnterTestApplication");
77         button.setStyleName("ControlPane.Button");
78         button.addActionListener(new ActionListener() {
79             public void actionPerformed(ActionEvent e) {
80                 InteractiveApp.getApp().displayTestPane();
81             }
82         });
83         controlRow.add(button);
84         
85         Column infoColumn = new Column();
86         infoColumn.setInsets(new Insets(20, 5));
87         infoColumn.setCellSpacing(new Extent(10));
88         splitPane.add(infoColumn);
89         
90         label = new Label("Please read the following before using the test application:");
91         label.setFont(new Font(null, Font.BOLD, null));
92         infoColumn.add(label);
93         
94         label = new Label("This application was built to interactively test components of Echo2 during development. "
95                 + "It is also being (mis)used as a public demonstration of Echo2's capabilities. "
96                 + "Note that if this is a development version of Echo, then some "
97                 + "of the features and capabilities demonstrated in this application may not be complete.");
98         infoColumn.add(label);
99         
100         label = new Label("Note that you may watch the AJAX XML messages being sent between the client and server by "
101                 + "enabling \"Debug Mode\". Debug Mode may be enabled "
102                 + "by appending \"?debug\" to the end of the URL of this application (for example: "
103                 + "\"http://demo.nextapp.com/InteractiveTest/ia?debug\"). "
104                 + "Please be aware that Debug Mode will in most cases result in EXTREMELY SLOW PERFORMANCE. "
105                 + "You may exit Debug Mode at any time by simply closing the Debug window.");
106         infoColumn.add(label);
107
108         label = new Label("Please visit the Echo2 Home Page @ http://www.nextapp.com/products/echo2 for more information.");
109         infoColumn.add(label);
110         
111         Column column = new Column();
112         column.setRenderId("MainColumn");
113         column.setStyleName("WelcomePane.Column");
114         add(column);
115         
116         label = new Label(Styles.NEXTAPP_LOGO);
117         column.add(label);
118         
119         label = new Label(Styles.ECHO2_IMAGE);
120         column.add(label);
121         
122         label = new Label(Styles.INTERACTIVE_TEST_APPLICATION_IMAGE);
123         column.add(label);
124     }
125 }
126
Popular Tags