Add a temporary hard-coded notice for the extended token validity period. This should...
[pithos] / gss / src / gr / ebs / gss / client / AboutDialog.java
1 /*\r
2  * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd.\r
3  *\r
4  * This file is part of GSS.\r
5  *\r
6  * GSS is free software: you can redistribute it and/or modify\r
7  * it under the terms of the GNU General Public License as published by\r
8  * the Free Software Foundation, either version 3 of the License, or\r
9  * (at your option) any later version.\r
10  *\r
11  * GSS is distributed in the hope that it will be useful,\r
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14  * GNU General Public License for more details.\r
15  *\r
16  * You should have received a copy of the GNU General Public License\r
17  * along with GSS.  If not, see <http://www.gnu.org/licenses/>.\r
18  */\r
19 package gr.ebs.gss.client;\r
20 \r
21 import com.google.gwt.core.client.GWT;\r
22 import com.google.gwt.user.client.ui.Button;\r
23 import com.google.gwt.user.client.ui.ClickListener;\r
24 import com.google.gwt.user.client.ui.DialogBox;\r
25 import com.google.gwt.user.client.ui.HTML;\r
26 import com.google.gwt.user.client.ui.HasHorizontalAlignment;\r
27 import com.google.gwt.user.client.ui.KeyboardListener;\r
28 import com.google.gwt.user.client.ui.VerticalPanel;\r
29 import com.google.gwt.user.client.ui.Widget;\r
30 \r
31 /**\r
32  * The 'about' dialog box.\r
33  */\r
34 public class AboutDialog extends DialogBox {\r
35 \r
36         /**\r
37          * The widget constructor.\r
38          */\r
39         public AboutDialog() {\r
40                 // Set the dialog's caption.\r
41                 Configuration conf = (Configuration) GWT.create(Configuration.class);\r
42                 String service = conf.serviceName();\r
43                 setText("About " + service);\r
44                 setAnimationEnabled(true);\r
45                 // Create a VerticalPanel to contain the 'about' label and the 'OK'\r
46                 // button.\r
47                 final VerticalPanel outer = new VerticalPanel();\r
48 \r
49                 // Create the 'about' text and set a style name so we can style it with CSS.\r
50                 final HTML text = new HTML("This is the Web client for the " + service + " service. You " +\r
51                                         "can use it to store, retrieve and share files in the " + service + " server " +\r
52                                         "grid. <p>Design and implementation: <a href='http://www.ebs.gr' target='about'>EBS</a></p>");\r
53                 text.setStyleName("gss-AboutText");\r
54                 outer.add(text);\r
55 \r
56                 // Create the 'OK' button, along with a listener that hides the dialog\r
57                 // when the button is clicked.\r
58                 final Button confirm = new Button("Close", new ClickListener() {\r
59 \r
60                         public void onClick(Widget sender) {\r
61                                 hide();\r
62                         }\r
63                 });\r
64                 outer.add(confirm);\r
65                 outer.setCellHorizontalAlignment(confirm, HasHorizontalAlignment.ALIGN_CENTER);\r
66                 outer.setSpacing(8);\r
67                 setWidget(outer);\r
68         }\r
69 \r
70         /*\r
71          * (non-Javadoc)\r
72          *\r
73          * @see com.google.gwt.user.client.ui.PopupPanel#onKeyDownPreview(char, int)\r
74          */\r
75         public boolean onKeyDownPreview(final char key, final int modifiers) {\r
76                 // Use the popup's key preview hooks to close the dialog when either\r
77                 // enter or escape is pressed.\r
78                 switch (key) {\r
79                         case KeyboardListener.KEY_ENTER:\r
80                         case KeyboardListener.KEY_ESCAPE:\r
81                                 hide();\r
82                                 break;\r
83                 }\r
84 \r
85                 return true;\r
86         }\r
87 \r
88 }\r