Professional Documents
Culture Documents
Author ........................................................................................................................................................ 1
Learner ...................................................................................................................................................... 2
Source code.............................................................................................................................................. 4
Chapter 1: Introduction ..................................................................................................................... 6
Development Tool.............................................................................................................................. 9
Widget, Panel, Event .......................................................................................................................10
Software used for the source code ...........................................................................................14
Source Code ........................................................................................................................................15
Reference .............................................................................................................................................18
Chapter 2: Create HTML Page using GWT ...............................................................................20
Generate GWT Application Project in Eclipse .....................................................................24
Create GWT Module Descriptor File ........................................................................................29
Create GWT Application Entry Point .......................................................................................39
Create Host HTML Page .................................................................................................................49
Compile and Execute GWT Application ..................................................................................58
Chapter 3: Horizontal Panel, Vertical Panel, Grid Panel ....................................................69
Declarative User Interface............................................................................................................73
XML Namespace................................................................................................................................76
Horizontal Panel ...............................................................................................................................78
Vertical Panel .....................................................................................................................................79
Grid Panel ............................................................................................................................................80
GwtPanel.java.....................................................................................................................................83
PanelEntryPoint.java ......................................................................................................................96
Chapter 4: Data Entry Form ........................................................................................................ 104
Label .................................................................................................................................................... 108
TextBox .............................................................................................................................................. 111
PasswordTextBox ......................................................................................................................... 113
RadioButton..................................................................................................................................... 119
TextArea ............................................................................................................................................ 121
Button ................................................................................................................................................. 123
HIdden................................................................................................................................................ 125
UIObject and FocusWidget Attribute ................................................................................... 127
Theme Configuration in Module Descriptor ..................................................................... 137
Chapter 5: Adding Event to Data Entry Form, and Read the Data ............................. 144
Event ................................................................................................................................................... 148
Define Event on Widget .............................................................................................................. 151
Event Type........................................................................................................................................ 154
Read Data from the Widgets .................................................................................................... 160
Drag and Drop Events ................................................................................................................. 175
Event Trace TextArea .................................................................................................................. 184
Appendix: Installation Guide ...................................................................................................... 190
Introduction..................................................................................................................................... 192
JDK10 Installation ......................................................................................................................... 193
Eclipse 4.7 Installation ................................................................................................................ 195
GWT 2.8.2 SDK and GWT Eclipse Plugin Version 3 Installation ............................... 197
Chrome Browser Installation................................................................................................... 209
Configure Default Internet Browser in Eclipse ................................................................ 210
Appendix: Import Project into Eclipse ................................................................................... 215
Index ...................................................................................................................................................... 227
GWT 2.8.2 Declarative User Interface WebApp Development
Copyright © 2018, by MillionStrengthKnowledge.com, All rights reserved.
The publication of the book and source code are protected by copyright, and permission must be
obtained from the MillionStrengthKnowledge.com prior to any prohibited reproduction, storage in a
retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying,
recording, or likewise.
Every effort has been made in the preparation of this book and source code to ensure the accuracy of
the information presented. However, the information contained in this book and source code are sold
without warranty and guarantee, either express or implied, as to the accuracy or completeness of or
results to be obtained from using the book and source code. Neither the
MillionStrengthKnowledge.com, author, nor its dealers and distributors will be held liable for any
damages caused or alleged to be caused directly or indirectly by this book and source code. Under no
circumstances shall MillionStrengthKnowledge.com, author, its dealers and distributors be liable for
any indirect, incidental, special, punitive, consequential or similar damages that result from the use of
or inability to use the book and source code, even if any of them has been advised of the possibility of
such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such
claim or cause arises in contract, tort or otherwise.
https://millionstrengthknowledge.com
Unique Number: 18790-01-63328-7
AUTHOR
My name is Eric Fong. I started my career as a software developer since 2001. I have extensive
experience with developing web application using Java and JavaEE. I received a Master Degree in
Management Information System from Coventry University. I have these professional certificates:
Oracle Certified Expert JavaEE6 EJB3.1 Developer, Oracle Certified Professional JavaSE8 Developer,
Sun Certified Business Component Developer for J2EE, Sun Certified Web Component Developer for
J2EE, and Sun Certified Programmer for Java 2 Platform 1.4.
I am the founder of MillionStrengthKnowledge.com. I created the GWT 2.8.1 Declarative User Interface
Web Application Development Self Pace Training in year 2017. I am very interested in Java and GWT
related application development, I enjoy doing research and development in Java and GWT during my
spare time.
When explaining the content of the book, author uses the term ‘learner” to refer to the reader of the
book.
When the webpage is opened, search for “Ebook preview” section, then click on the “Preview source
code” to download the source code in zip file format.
Figure 1 Widget
Figure 2 Panel
Figure 3 Event
Figure 4 Classpath
<inherits> tag
Figure 14 GwtProgram.java
onModuleLoad()
Figure 17 onModuleLoad()
Selection script
Figure 23 Refresh
programmatic method
1 Owner class
ui.xml
2 ui.xml
Tabular format
Figure 31 Tabular format
4 HTMLPanel
Owner class
Figure 33 Owner class
@UiTemplate annotation
Figure 34 @UiTemplate annotation
Figure 37 CreateAndBindUi
@UiField
Figure 38 @UiField
Figure 39 initWidget()
Figure 40 java.util.logging.Logger
Figure 43 Label
Figure 44 horizontalAlignment
directionEstimator
Figure 45 directionEstimator
Figure 46 wordWrap
Figure 47 TextBox
Figure 48 maxLength
visibleLength
Figure 49 visibleLength
textAlignment
Figure 50 textAlignment
Figure 51 PasswordTextBox
Figure 52 CheckBox
Figure 53 formValue
Figure 54 ListBox
Figure 55 multiSelect
visibleItemCount
Figure 56 visibleItemCount
Figure 58 group
Figure 59 TextArea
Figure 60 visibleLines
textAlignment
Figure 61 textAlignment
readOnly
Figure 62 readOnly
Figure 63 Button
Figure 64 Hidden
Invisible component
Figure 66 defaultValue
Figure 67 UIObject
FocusWidget
Figure 68 FocusWidget
Figure 72 VerticalPanel
HorizontalPanel
Figure 73 HorizontalPanel
Figure 74 borderWidth
spacing
Figure 75 spacing
Figure 76 horizontalAlignment
Figure 77 verticalAlignment
Figure 78 borderWidth
cellSpacing
Figure 79 cellSpacing
cellPadding
Figure 80 cellPadding
Figure 81 Theme
@UiField annotation
preventDefault() method
Figure 104 Configure GWT Plugin Setting to Ignore Missing gwt-servlet.jar Error