Information about http://www.manning.com/hanson/excerpt_index.pdf

Tags: abstract class, anonymous classes, apache 99, apache foundation, apache tomcat, api, appl, application loading, architecture, assertion, directory structure, interface, servlet, shell script, testing and debugging, widget, wildcard,
Pages: 17
Language: english
Created: Wed May 9 11:28:50 2007
Display cached document
Page 1
image
Page 2
image
Page 3
image
Page 4
image
Page 5
image
Page 6
image
Page 7
image
Page 8
image
Page 9
image
Page 10
image
Page 11
image
Page 12
image
Page 13
image
Page 14
image
Page 15
image
Page 16
image
Page 17
image
                                                                                     index
Symbols                           anonymous classes, reason to        testing and debugging in
                                       avoid 423                         hosted mode 86­94
$wnd.__dispatchEvent() 200        Ant 48, 99                        application-compile script 62
$wnd__dispatchEvent() 199         ant flag 48                       applicationCreator tool 30, 44,
* wildcard 549                    Apache 99                              46, 48, 50, 53, 62, 353, 543
@typeArgs 359, 362­363            Apache Foundation 462             application-loading
                                  Apache Tomcat 548                      mechanism 564­572
A                                   directory structure 550         application-shell script 62
                                    servlet engine 87               architecture 376
About 133­134                     API, exposing 278, 294            ArrayList 362
About menu, automatic             Appl-i18n tool 45                 assertion methods 533
     generation of 472            application                       assignable type 475
                                    altering for locale 518­520     AsyncCallback interface
AbsolutePanel 171
                                                                         369, 384­385, 388­391
  add(Widget, x, y) 171             compiling 94­98
                                                                    asynchronous code
  getWidgetLeft() 171               constructing 72­83
                                                                      testing 537­539
  getWidgetTop() 171                creating 44, 50, 54­63          asynchronous communication
  setPosition(Widget, x, y) 171     cross-script 572                     348, 350­351
abstract class 133                  defining server                 asynchronous mode 537
AbstractAsyncHandler 389               resources 326­327            asynchronous service
AbstractImagePrototype 130          deploying 98­99, 539­553             interface 367, 371
add() 160­161                       developing 67­86                asynchronous testing 537­539
add(Widget,String) 172              executing in debug mode 92      automatic updates 394
addChangeListener 259               implementing
addDashboardComponent()                internationalization 56­57
                                                                    B
     190                            internationalization 54­56
addMenu() 275                       large 67                        bin directory 550
Address Book 136, 218, 232          legacy 565                      Black Hat convention 352
  handling scrolling 225            loading mechanism 564­572       blacklist argument 88
  handling tab events 232           logging 100­103                 _blank frame name 421, 430
addRowToGrid() 380                  manaing GTP                     blocking 392
addStyleName() method 85               properties 327­332             comparison to polling 398
adopting widgets 184                running in web mode 99            implementing on client 399
Ajax 111, 113                       setting entry point 337           implementing on server
  with RequestBuilder 410­424       standard 566­567                     399­401
AlphaImageLoader filter 149         styling 83­86                     server threads 398­401


                                                581
582         INDEX




Book application 125, 235       callbacks                        ClickListenerCollection 213
  managing tree events 235         chaining 386­388                 fireClick() 213
bookmarks 417                      handler 373, 416              client code, structuring 376­391
Bookmarks menu                     mechanism 385                 client package 364
  designing 417­418                object, creating 369­370      client, implementing
  XML data file 418­419            routine, using Command              blocking 399
boolean readBoolean() 406             Pattern 384­391            client-pull 393
booleanValue() 447              cancelLabelChange() 262          client-side RPC architecture 375
bootstrapping, standard         canProcess() 400                 code
     applications 567­572       capturing                           compiling 94­98
breakpoints, setting 92            long text 433                    deploying 98­99
browser                            text 432                      ColourPicker 270
  change title of 128           Cascading Style Sheets              constructing 273­274
  communicating via GWT               (CSS) 42, 80, 85, 355      com.google.gwt.http.HTTP 455
     Java 291­292                  class-naming convention 268   Comet 393
  communicating via                styling widgets 117           Command 122
     JavaScript 292­293         CellFormatter 179                   execute() 122
  detection of type 560         CellPanel 176                    command class 388
  determining which is being       HasHorizontalAlignment 177    Command interface
     used 330                      HasVerticalAlignment 177            81, 419­420
  managing differences          CGI 410                          command object 385
     496­502                    CGI (Perl module) 466            Command pattern 122, 376,
  tab index 133                 chaining callbacks 386­388             384, 386­391
browser events, handling        ChangeListener                   commons-fileupload library 436
     standard 216­231                 136, 218­221, 259          commons-httpclient library 461
browser functionality,             addChangeListener() 265       compilation 94
     accessing 278                 fireChange() 272                 -gen 96
                                   onChange() 219                   GWT 556­564
browser-specific code 328
                                ChangeListenerCollection            GWT, file mapping 557
builder, creating 414
                                      259, 265                      GWT, output 559
Button 35, 248, 252, 427, 454
                                changeTextLabel() 263               heap size errors 97
  click() 138
                                char readChar() 406                 -logLevel 95
  GWT Java class 112
                                Character.isDigit() 141             -out 96
  Java object 112
                                characters, escaping 412            output infomration in tree
, DOM element 114       CheckBox 138                           format 95
Button widget 78, 80, 137­138      for boolean values 433­434       setting level of logging 95
ButtonPanel 186                 class replacement, DOM 332          setting location for generated
  creating 183­185              classes                                code 96
byte readByte() 406                abstract 390                     setting location of output
                                   locale-specific 519­520             code 96
C                                  schedulable 395­398              setting the style of output
                                classpath                              code 96
cache.html 563                     confusion with GWT               speeding up the process of 97
cache.xml files 561­563               modules 322                   -style 96
  identification of browser        relation to GWT module           -treeLogger 95
    choices 563                       file 83                       viewing results 97­98
Calculator 138, 140, 221, 223   ClickListener 36, 212­213,       compilation process
  handling clicks 221                 221­222, 252, 454, 460        benefits of 561
  managing keyboard                addClickListener() 213           drawbacks of 561
    events 223                     removeClickListener() 213     compilation script 95
                                                                                 INDEX        583



compiler 6                        continuously updated              DashboardPanel 204, 208,
  flags 573                            component 393­398               215, 222, 274, 298, 477
  making output more              convention 388                    debugging 92­94
     readable 573                 CPAN 467                          deploying the code 98­99
  web mode 573                    createConfirmButton() 262         description 65­67
compiling 94­98                   createImage() 130                 developing your
complex panels 162                ­createMessages flag 56              application 67­86
complexity, reducing 382          createOptionsMenu() 488           directory structure 51, 59
ComplexPanel 170­178              creation tools 39                 drag and drop 65
component shell, writing            application creator 44, 48,     EditableLabel
     377­380                           50, 53, 62                      131, 247­249, 253
components                          i18nCreator 511                    building 250, 258­269
  continuously updated              internationalization               change text
     393­398                           creator 45, 54­55, 62                 notification 220
  labels, adding 380­382            project creator 44, 47­48, 50      choosing panel layout and
  shell, writing 377­380            unit testing 45, 57­58, 62               structure 253­255
  style, adding 380­382           cross-script applications 572        creating 259­260, 263
Composite 378                     cross-site request forgery 351       FlowPanel 173
  initWidget() 248                CSS. See Cascading Style Sheets      identifying
composite panels 162, 181­182          (CSS)                                 components 251­253
                                  custom field serializer 402­407      implementing GWT Java
composite widgets 247, 251
                                    class rules 403                          interfaces 255­258
  building 258­265
                                    reasons to write 402               multiple text lines 140
  creating 262
                                  CustomFieldSerializer 403
  creating from other compos-                                          styling 267­269
     ite widgets 269­274                                            externalvisibility
  definition 247                  D                                    property 123, 521, 563, 569
  development steps 248­249                                         final version 522­523
  initializing 263                Dasboard.html 558                 Finance News 518
                                  Dashboard 50­53, 74, 95,          Flash movie widget 496
  initWidget() 263
                                      97, 103, 522                  FlashMovieImpl 499
  layout 253
                                    About 133­134
  setWidget(), deprecated 263                                       generator 477­492
                                    About menu 472
  styling 267­269                                                   getConfirmDelete() 298
                                    adding JUnit tests 57
conf directory 550                                                  getDashboardName() 296
                                    Address Book 135­136,
configuration 14                      168, 206, 218, 225, 232       Google Video Search
configuring production              Book 125, 235                      308, 336
     environment 550­552            bookmark menu 124               importing into Eclipse 60
confirmDelete 190                   Calculator 138, 140, 167,       internationalization
constants                             181, 221, 223                    54­57, 68­72
  avoiding writing directly 503     Colour Picker 269               internet view 520
  moving to resource file 503       compiling the code 94­98        intranet view 520
  referring to as string            component applications          key functionality 65
     literals 503                     65­66, 81                     languages 54
Constants interface 14              confirmDelete 297               Login 140, 173, 177
containsKey() 450                   creating panel for 187­190      menu system 65, 121
content delivery                    Dashboard_APITest.html 296      module XML file 337­339
  client-pull 393                   Dashboard_intranet              onEventPreview 209
  server-push 392­393                 class 123, 523                passing data between inde-
  techniques 392                    DashboardComposite                 pendent applications 297
content-type 415                      274­276, 334, 477             PNGImage 147­148
Content-type header 414             DashboardContainer 188          processing XML 65
584        INDEX




Dashboard (continued)               onMouseMove 240                determining browser 330
  running in hosted mode            onMouseUp 240                  development lifecycle. See lifecy-
     90­91                        Dashboard-shell 90                    cle
  running in web mode 99            altering classpath 340         DialogBox 164­166
  Search Comparison 174           Dashboard-shell script 87          creating 165
  Server Status 131, 164, 180,    data                             Dictionary 15, 517
     232, 234, 327                  hiding with Hidden 435­436       get(key) 517
  setConfirmDelete() 298            pagination 180                   getDictionary 517
  setDashboardName() 295          data objects 348                 DiskFileItemFactory 438
  Slider 270­273                    JSON 445­450                   disowning widgets 184
  Slideshow 119, 128, 563           serializable 356­360            160
  Stage 6 99                      DBIx::JSON 467                   div element 78
  testing and debugging in host   debugging                        DockPanel 175­177
     mode 86­94                     hosted mode 86­94              DOM
  ToggleMenuItem                    using JUnit messages 532         browsers dealing with 332
     150­151, 154­155               using rebind decision            browser-specific methods 497
  Tooltip 231                          files 542                     creating an element 144
  Trash Icon 216                  DeckPanel 170, 173­174             div element 78
                                    getVisibleWidget() 174           eventCancelBubble() 200
  TwoComponentMenuItem
                                    showWidget(int) 174              eventPreventDefault() 200
     124, 150­153, 177
                                  decodeComponent() 412              getElement() 144
Dashboard.css file 84
                                  default application                getting specific named 171
Dashboard.gwt.xml file
                                    HTML file 72­77                  implementation class
     72, 81, 86
                                    Java file 77­81                     hierarchy 497
Dashboard.html file 72­73, 86                                        named 74
                                    module XML file 72, 81­83
Dashboard.java file 72, 77                                           setAttribute() 144
                                  default browser event,
Dashboard_APITest.html 294                                         DOM pages, getting
                                       preventing 216
Dashboard-compile, altering       defaultexcludes attribute 326         reference 171
     classpath 340                deferred binding 71, 149         DOMImplIE6 280
DashboardComposite 334              creating DOM class             DOMImplStandard 197, 280
  definition of 274­276                instances 497               double readDouble() 406
DashboardCompositeGenerator         with generators 474, 491       drag-and-drop
       334                        DeferredCommand 272                drag 236­241
DashboardConstants interface      define-property tag 495            drop 241­244
     file 80                      defining                           implementing 236­244
DashboardConstants.java             new properties 328             DummyCommand 81
     file 68, 72                    server resource 327            dynamic string
DashboardConstants.properties     deploying                             internationalization
       69, 506                      applications 539­553                516­518
DashboardConstants_sv.proper-       code 98­99
     ties 507                       to a filesystem 99             E
DashboardConstants-i18n             to a web server 98
     tool 55­56, 68­70, 508       deployment descriptor 549        Echo2 26
DashboardContainer 188              writing 552­553                Eclipse
DashboardMessages.properties      deserialization 350, 402            importing into 60­61
     512                            pattern 404                       launch configuration 51
DashboardMessages-i18n 512        deserialize() 403­404, 406­407      launch files 534
DashboardPanel 200, 274, 298      Design Patterns: Elements of     -eclipse flag 39, 47, 51, 59, 61
  gaining and losing focus 222         Reusable Object-Oriented    EditableLabel 140, 220
  ignoring event 208                   Software 382                   managing change 220
  onMouseDown 239                 DETAILED option 90               EMBED tag 498
                                                                           INDEX       585



encapsulating remote calls     eventGetClientY 205             onError 127
     382­384                   eventGetCtrlKey 205             onEventPreview() 208
encodeComponent() 412­413      eventGetFromElement 205         ONFOCUS 194
encoding-type 436              eventGetKeyCode 205             onHistoryChange() 119
endless loop, creating 400     eventGetRepeat 205              ONKEYDOWN 194
entry point                    eventGetScreenX 205             ONKEYPRESS 194
  setting 337                  eventGetScreenY 205             ONKEYUP 194
EntryPoint interface 34, 78    eventGetShiftKey 205            ONLOAD 194
  class 80                     eventGetTarget 205              onLoad 127
errors, handling with tests    eventGetToElement 206           ONLOSECAPTURE 194
     532­533                   eventGetType() 204, 206         ONMOUSEDOWN 194
escaped values                 eventGetTypeString 206          ONMOUSEMOVE 194
  decoding 412                 eventPreventDefault()           ONMOUSEOUT 194
  encoding 412                    200, 216                     ONMOUSEOVER 194
escaping 413                   EventPreview 208­210            ONMOUSEUP 194
  characters 412               finding a listener 199          ONSCROLL 194
  URLs 412                     FOCUSEVENTS 194                 PopupListener 232
event handling, preventing     FocusListener 215, 275          preventing previewing 188
     default in browser 216    form events 231                 previewing 208­210
event listeners                getting the type of 204         ScrollListeners 224­226
  ChangeListener 136           GWT event model 196­200         sinkEvent() 197, 202
  ClickListener 131, 138       GWT handling lifecycle 197      sinkEvents() 197, 200­203
  HistoryListener 119          handling 193, 199               sinking 200­203
  KeyboardListenerAdapter      handling by extending lis-      super.onBrowserEvent() 197
     141                          tener classes 211­212        tab events 232­233
  LoadListener 127             handling double click 200       table events 234
  MouseListener 131            handling standard browser       TableListener 178, 234
  PopupListener 124               events 216­231               TabListener 181
  TreeListener 126             identifying event model         tree events 235­236
Event object 204                  browser differences          TreeListener 235
eventBits attribute 114, 202      195­196                      unsinkEvents() 205
__eventBits field 203          KeyboardListener 140, 168       W3C DOM model 196
EventListener 211, 214         KEYEVENTS 194                   window close events 227­231
EventPreview 208­210           linking sunk events to          Window CloseListener 293
events 193                        onBrowserEvent() 207­208     window resize events 226­227
  addEventListener() 196­197   listening 200­216               WindowCloseListener
  bubbling 195                 LoadListener 223                   227­231
  BUTTON_LEFT 193              managing sunk events            WindowResizeListener
  BUTTON_MIDDLE 193               203­207                         226­227, 271
  BUTTON_RIGHT 193             MOUSEEVENTS 194               examples
  capturing 195                MouseListener 211               applicationCreator 30
  capturing right mouse        moving into GWT code            Server Status 353­356
     clicks 206                   212­216                      Tic-Tac-Toe 32
  ChangeListener 218­221       ONBLUR 193                    exceptions
  ClickListener 212            onBrowserEvent() 197, 199,      JSNI 290
  closing pop-ups 231­232         203, 207­208                 serializable 363
  dispatchEvent() 197          ONCHANGE 193                    throwing 363
  eventCancelBubble() 200      ONCLICK 193                   excludes 326
  eventGetAltKey 205           ONDBLCLICK 194                execute() 420
  eventGetButton 205           onDetach() 200                existing methods,
  eventGetClientX 205          ONERROR 194                        overwriting 484­485
586         INDEX




exposing an API 294               flexibility, adding 390          G
extending properties 329          FlexTable 179­180
extend-property tag 495              FlexCellFormatter 180         gen argument 90, 96
Extensible Messaging and Pres-    Flickr, label editing 250        generate() 476
     ence Protocol (XMPP) 342     float readFloat() 407            generating new code
externalvisibility property 95    FlowPanel 159­160,                    automatically 471­491
extractYahooResults() 458               173, 253, 454              GeneratorContext 478
                                     getWidget(int) 173            generators 472
F                                    getWidgetCount() 173            amending classpath to
                                     getWidgetIndex(Widget) 173         use 473
Façade pattern 376, 382­384          remove(int widgetIndex) 173     basic code 476
failure, different than an           setting style of 263            context argument 476
      error 532                   FocusListener 215, 222, 275        context properties 479­480
field serializers                    onFocus() 275                   DashboardComposite-
                                     onLostFocus() 275                  Generator 334
   class 403­404
                                  FocusPanel 164, 167­168            deferred binding with 474
   custom 402­407
                                     setFocus() 168                  generate() 478
   custom, class rules 403
                                     setTabIndex() 168               generating classes 563
   custom, implementing
                                                                     GeneratorContext object 478
      404­407                     FocusWidget 133­141, 143, 167
                                                                     input class 478­479
   custom, reasons to write 402      setAccessKey() 133
                                                                     internationalization 472
file uploads 436                     setFocus() 133
                                                                     introduction 472­473
file-input tag 425                   setTabIndex() 133
                                                                     JUnit 472
FileItemFactory 438                425
                                                                     logging progress 480­482
files, uploading with             form action 426
                                                                     logging to a TreeLogger 476
      FileUpload 436­439          form controls 425­426
                                                                     makeInterface() 483
filesystem, deploying to 99       form encoding 415                  PrintWriter 483
FileUpload 118­119, 436­439       form method 425                    PropertyOracle object 479
   getFilename() 119              FormHandler 428                    registering 333­334, 474
   getName() 119                     onSubmit() 428                  returning new class 491­492
   old version 143­146               onSubmitComplete() 428          returning null as the
   server-side component 118      FormPanel 164, 166­167,               result 476
   setName() 119                        410, 424­439                 RPC 472
FileUploadException 438              events 428­429                  SourceWriter 478, 482
FileUploadServlet class 118          form controls 432­439           TreeLogger 480
filtering public resources 326       setAction() 426                 TypeOracle 478
finishTest() 538                     setMethod() 426               generics 358
fireChange() 265                     submit() 167, 427             GET 411­413
Firefox Web Developer                submitting 427                  compared to POST 413­414
      extension 73                   target, altering 429­431      get() 171, 450
Flash widget                      FormPanel.METHOD_GET 426         get(elementName) 171
   building 498­501               FormPanel.METHOD_POST            getAttribute() 144
   Internet Explorer 498                426                        getCellFormatter() 179
   Internet Explorer              forms, handling events 231       getDescription() 290
      implementation 500­501      FormSubmitCompleteEvent          getElement() 114, 378
   other browser                        428                        getGSearch() 315
      implementation 500          Frame 134                        getInstance() 382­383, 447
   other browsers 498             frame.setURL('resource-to-       getMetaProperty() 521
FlexCellFormatter 180                   load') 134                 getName() 290, 427
   spanning cells and rows 180    frames, named 429                getprint() 467
                                                                                  INDEX       587



getResult() 428                   compilation process,               GWT applications
getRowFormatter() 179                output 559                        talking between 296­298
getStatusCode() 416               compilation, file                    talking to via JavaScript
getStatusData() 361, 382,            mapping 557                          API 294­296
    384, 387                      compiler 41                        GWT Interfaces
getStatusDataFromServer()         components styling 83                HasText 144
    380, 385, 397                 creating applications              GWT Widget Library 147, 340
getType() 479                        39, 44­63                       GWT.create() 71, 80, 366, 368
getValue() 447                    creation tools 39­42, 46,          GWT.create(classLiteral) 474
getWidgetCount() 173                 51­52, 62, 67                   GWT.getModuleBaseURL() 369
getWidgetIndex(Widget) 173        default application 39, 44,        GWT.isScript() 369
Google Ajax Search                   47, 50, 65, 105                 gwt.js 544, 558­559
    299, 301, 309                 development lifecycle. See life-   gwt.js JavaScript file 75
  API key 299                        cycle                           GWT.log() 101­102, 370
  GdrawOptions 310                DOM implementation class           gwt:module meta-tag 74
  GnewsSearch 310                    hierarchy 497                   gwt:onPropertyErrorFn meta-
  GSearchControl 310              event model 196­200                     tag 75
  GsearcherOptions 310            generators 65­66, 71, 473          gwt:property meta-tag 75
  GwebSearch 310                  getModuleBaseURL()                 GWTDesigner 63
                                     method 553                      gwtOnLoad() 572, 578
  KeepListener 312
                                  history functions 76               gwt-onLoadErrorFn meta-tag 75
  making the widget 314
                                  hosted-browser 41                  GWT-RPC 348, 376
  SearchControlImpl 311
                                  integration into Eclipse 59          defining 360­366
Google Groups 464
                                  internationalization                 implementing 356­370
Google Maps 300                      support 502
Google Video Search 300, 336                                           preparing client side of
                                  introduction 5
  GSvideoBar object 303                                                   call 366­370
                                  local, altering the
  injecting JavaScript                                                 RPC concepts 348­353
                                     application 518
    source 336                                                         servlets 550
                                  modularization 68
  JavaScript example 303                                             gwt-servlet.jar 551
                                  module XML 318
  making the widget 306                                              GWTShellServlet 549
                                  online API reference 118
Google Web Toolkit. See GWT                                          GWTTestCase 22, 537
                                  open source 564
Googlipse 63                      properties 495                       delayTestFinish()
Grid 35, 138, 181                                                         method 537
                                  properties,
GWT 4                                externalvisibility 479            finishTest() method 537
  $doc 290, 292                   stages of application                setModuleName()
  $wnd 290, 292, 294                 development 42                       method 537
  application development         testing and deploying              gwt-user.jar 280
    lifecycle 39­43                  527­554
  application-loading             testing code with JUnit            H
    mechanism 564­572                528­539
  browser differences 496         user.agent property 495            handleFailure() 389
  compilation 556­564             user-defined properties 520        handler 35
  compilation process             using IDEs other than              handleSuccess() 389
    556, 564, 573                    Eclipse 62                      HasHorizontalAlignment 256
  compilation process, file       vs. Echo2 26                         required methods 259
    mapping 557                   vs. JavaServer Faces 27            HashSet 362
  compilation process, Java       vs. Ruby on Rails 29               HasName 257, 427
    objects supported 574         vs. Swing 25                       HasText 143­144, 255­257
  compilation process, knowl-     widgets default style names 85       required methods 259
    edge of browser types 561    565                     HasWidgets interface 163
588         INDEX




HasWordWrap 256                    HTML widget 132­133              Image 127­131
  required methods 259             HTMLPanel 172                      getURL() 150
heap size 97                       HTMLTable 170, 178­179             PNG problem with Internet
HelpMenuName key 69                  setting style of cells 179           Explorer 147
Hidden, hiding data 435­436        HTTP                             image.setVisibility(false) 224
hiding text 433                      GET 411­413                    ImageBundle 129
History 119                          GET, compared to               images
  getTargetHistoryToken() 120           POST 413­414                  bundling together 128
  HistoryListener 119                methods 411­414                  loading 223­224
  including in HTML page 120         POST 413­414                   importing into IDE 59­63
  onHistoryChange() 119              response codes 416             includes 326
  setTargetHistoryToken() 120      HTTP module                      indent() 484
history                              importing to module            IndexedPanel 173­174
  history.html 564                      configuration 412           inheriting other modules
  storage 564                        RequestBuilder 414                   321­325
history files, removing 543        HTTPRequest 111                   365
history functions 76               HttpServlet 372                  inherits tag 365
History object 21                  Husted, Ted 57                   init() 196
history tokens 120                 Hyperlink 119­120, 460           initialization code 578­579
history.html 543, 558                getText() 120                  Initializing a Composite
History.html file 564                setText() 120                        Widget 263
HistoryListener 21, 119              treating as HTML 120           initWidget() 379
HorizontalPanel 170, 177, 253        treating as text 120           injecting a style sheet
hosted development                 hyperlinks, creating a true            resource 336
     controller 91                      hyperlink 133               injecting JavaScript code 335
hosted mode 333, 369, 573                                           injection 86
  default project URL 365          I                                innerHTML 149
  deployment descriptor 552                                          428
  -gen 90                          i18n 45, 54­56                   installing RPC servlets 548­553
  -logLevel 89                        adding to a structure 55      instantiate() 403­405
  -noserver 87                        module XML file 319           int readInt() 407
  -out 90                          I18N GWT module 82               IntelliJ 63
  setting location for generated   i18nCreator 511                  intercomponent
     code 90                       i18nCreator tool 45, 54­55, 62         communication 297
  setting location of output       IDE 59                           internationalization 14, 45, 54,
     code 90                          Eclipse 39, 41, 44, 47, 50,         65, 68­72, 97, 328, 495, 560
  setting the style of output           53, 55, 57­60, 62             change locales 71
     code 90                          Googlipse 63                    constants 504­509
  -style 90                           GWTDesigner 63                  ConstantsWithLookup
  testing 365­366                     importing into 59­63                504, 509­510
  testing and debugging in            importing to 45                 default locale 69
     86­94                            IntelliJ 63                     Dictionary 517
  -whitelist 87                       Matisse 59                      dynamic string 516­518
hst() 564                             NetBeans 59, 63                 English 69
HTML 13, 252                          other than Eclipse 62           hierarchy 504
  getHTML() 120                       with GWT wizard 63              implementing 56­57
  security implications 133        IFRAME 76, 134                     ISO country code 502
  setHTML() 120                    iframes 424                        ISO language code 502
HTML panels 178­181                ­ignore flag 53, 59                key/value pairs 69
HTML Table panels 162              IllegalArgumentException 459       Localizable interface 504
                                                                                      INDEX         589



internationalization (continued)   Java libraries, adding to            loading 299­300
   Message 504                           classpath 90                   loading through HTML 299
   messages 510­512                Java method signature 289            loading through module
   messages for default            Java Native Interface. See JNI          XML 299­300
      locale 512­514               Java objects, passing across         third-party, accessing 278
   messages for other                    Java-to-JavaScript             wrapping as GWT
      locales 514­516                    boundary 283­286                  component 300­309
   messages structure 512          Java package                         wrapping complex 309­315
   properties files 69                client 43, 50­53,               JavaScript Native Interface. See
   setting up 54­56                      55, 57­58, 343                    JSNI
   static string 503­516              creating structure 343          JavaScript Object Notation. See
   supporting in full 502­518         rebind 54, 343                       JSON
   Swedish 69­70                      server 41, 43, 54, 343          JavaScript objects, keeping as
   use in the Dashboard            Java Runtime Environment 10             Java objects 310­312
      application 124              Java Virtual Machine (JVM) 97      JavaScript resources,
   use of generator 472            java.io.File 439                        injecting 335­336
InterruptedException 400           java.util.Set 450                  JavaScriptException 290
introspection 65, 485­491          JavaScript 278                     JavaScriptObject 284, 287,
   in generators 334                  $doc 290, 292                        302, 304
   JClassType 486                     $wnd 290, 292­294, 304, 311       GSVideoBar example 305
   JType 479                          access browser                  JavaServer Faces. See JSF
iSEC Partners 352                        functionality 278            JBoss 548
ISO country code 502                  call format 575                 JClassType.getFields() 486
ISO language code 502                 compiling Java to 573­579       JClassType.getMethods() 486
IsSerializable 357                    document object 290, 292        JNI 281
   interface 357­358, 361, 402        exposing an API 278, 294        JRE emulation library 10, 358
isString() 460                        files, organizing 544           JSF 27
iterator() 170                        including in a GWT              JSNI 8, 190, 281
                                         application 281­283            accessing a field in a Java
J                                     intercomponent                       object 285­286
                                         communication 278, 297         accessing a static field
Jabber 342                            libraries 278                        285­286
Jakarta project 461                   loose type model 280              accessing an instance
Java                                  permutations 495, 560­561            field 285­286
  class name 53­54                    permutations, cache.html 563      calling JavaScript code 282
  compiling to JavaScript             permutations, Dashboard 579       communicating using
     573­579                          permutations, reducing               290­298
  creating package                       number of 561                  creating new Java objects in
     structure 343                    permutations, selecting 561          JavaScript 283
  package structure 318               program code as 576­578           exceptions 290
  packages 343                        relocating code 544, 546­548      executing methods in Java
  strong type model 280               undefined object 287                 objects 287­290
  Vector class 574­576                variable 278                      introduction 279­290
Java 1.4 standard 81                  window object 290, 292, 294       JavaScriptObject 284
Java 1.5, use in GWT               JavaScript API, talking to GWT       passing a byte to
     generators 476                      application 294­296               JavaScript 283
Java 5.0 standard 81               JavaScript libraries                 passing a char to
Java classpath, confusion with        accessing objects 302­307            JavaScript 283
     GWT modules 322                  accessing of 278, 299             passing a double to
Java debuggers 101                    calling callback code 312­314        JavaScript 283
590        INDEX




JSNI (continued)                     using with Ruby 467­469        L
  passing a float to                 value types 469
     JavaScript 283               json library for Ruby 467         Label 131­132, 248, 252
  passing a JavaScriptObject      JSON.parse() 468                     adding a ClickListener 262
     to JavaScript 284            JSONArray 458                        adding to component
  passing a long to                  storing JSONValue                    380­382
     JavaScript 283                     objects 448­449                create as plain text 131
  passing a short to              JSONBoolean 447                      editing by clicking 250
     JavaScript 283               JSONException 459                    getText() 132
  passing a String to             JSONNull 447­448                     setHorizontalAlignment()
     JavaScript 284               JSONNumber 446                          131
  passing a user-defined Java     JSONObject 456, 459                  setText() 132
     object to JavaScript 284        collecting JSONValue              setWordWrap() 131
  passing an array to                   objects 449­450             Label object 78
     JavaScript 284               JSONParser 443, 445               Label widget 80
  passing an int to                  parse() method 459             legacy applications 565
     JavaScript 283               JSONString 446                    libwww-perl 465
  passing Java objects to         JSONTokenizer 464                 lifecycle 39­44, 67, 94, 103
     JavaScript 283               jsonToObj() 466                      stage 1, tools 45, 65
  returning a Java object 286     JSONValue 445­446, 458, 460          stage 2, development 67­86
  returning a                     JSONValue objects                    stage 3, testing and
     JavaScriptObject 287            collecing in JSONObject              debugging 86­94
  returning a String 286                449­450                        stage 4, compiling 94­98, 556
  returning null objects 287         storing in JSONArray              stage 5, deployment 98­99
  returning primitive types 286         448­449                        stage 6, running in web
  syntax 281                      JUnit 22, 45, 54, 57, 59                mode 99
                                     downloading 529                   stages 41
JSON 111, 469
                                                                    LinkCommand 419
  arrays 444                         JAR file 57
                                                                       loading web page 420­421
  basic types 446­447                overview for GWT
                                                                    List interface 362
  classes, adding to configura-         developers 529­534
                                                                    list, displaying in a ListBox
     tion file 453                   testing GWT code 528­539
                                                                          434­435
  creating Search                    version compatibility with
                                                                    ListBox 135­137, 434­435
     component 450­460                  GWT 529
                                                                       drop-down view 136
  data format 443­444             JUnit in Action 57
                                                                       getItemText() 136
  data objects 445­450            junitCreator
                                                                       getSelectedIndex() 136
  deserializing data 445             command-line options 534          getSelectedItem() 137
  format 443                         creating TestCase 534             setMultipleSelect() 137
  implementations 462                running 534­535                   setSelectedIndex() 137
  introduction 443­445            junitCreator tool 45, 57­58, 62      setting height 136
  module 453                      -junitflag 58                        standard view 136
  number 444                                                        listener.onBrowserEvent() 208
  Perl module 465                 K                                 listeners
  response 458                                                         ChangeListener 218­221
  sending data to server          keyboard events                      ClickListener 212, 252
     455­457                        eventGetKeyCode() 209              FocusListener 215
  server proxy 462                  getting key pressed 209            KeyboardListener 140
  server response 457­460         keyboard, capturing inputs 223       LoadListener 223
  using with Java on server       KeyboardListener 140, 168, 223       MouseListener 211
     461­465                      KeyboardListenerAdapter 223          PopupListener 232
  using with Perl 465­467         keySet() 450                         ScrollListeners 224­226
                                                                                  INDEX        591



listeners (continued)             menu system 65                     defining server resource 327
   TableListener 234              MenuBar 80, 121­124                extending properties 329
   TreeListener 235                 addItem() 122                    filtering public resources 326
   Window CloseListener 293         onPopupClosed() 124              GWT Widget Library 322
   WindowCloseListener              widget 80                        HTTPRequest 322
     227­231                      MenuItem 121­124, 150­155          include other modules
   WindowResizeListener             extending 146                       321­325
     226­227                        getCommand() 123                 injecting a style sheet 336
loading error function,             getParentMenu() 122              injecting JavaScript code 335
     registering 571                getSubMenu() 122                 internationalization 322
LoadListener 127, 223               setCommand() 123                 JSON 322
   onError() 223                    setSubMenu() 122                 packaging 341­343
loadSubMenu() 419, 423­424          treating as HTML 123             path to public resources 325
locale 502                        MenuLoaderHandler                  property provider 330
   changing 91                         419, 421­423                  registering Generator
   changing in HTML 506           menus, enabling/disabling auto-       class 333­334
   changing through URL 506            opening of children 123       replace class due to
   hierarchy 502                  menuTitle 423                         properties 333
   permutations based on 560      Messages 14                        setting source code path
locale-specific classes 519­520   metaProps 569                         325­326
Localizable interface 504         metatags 74, 545                   setting the entry point 337
localization 15                     gwt:module 568                   standard with GWT 319
Log4J 89, 103                       gwt:onLoadErrorFn 569, 571       third-party, using 339­341
Log4JavaScript 103                  gwt:onPropertyErrorFn 569        User 322
Log4Perl 103                        gwt:property 568­569             XML 322
Log4PHP 103                         processing 568                   XML processing 322
logging 100­103, 386                property, managing 569          Mouse events 207
   automatic 391                  methods                            eventGetButton() 207
   handler 389                      making final 391                mouse inputs 224
   in a generator 480­482           overwriting existing 484­485    MouseListener 211
   on the client side 100­103       using introspection 485­491      onMouseDown() 211, 237
   on the server side 103         Model View Controller. See MVC     onMouseMove() 237
logging levels 89                 modularization 68, 319­321         onMouseUp() 237
LoggingAsyncHandler 391             creating 318­339                multipart messages 436
Login 140                         module configuration 550          MVC 26
logLevel argument 89, 95            importing HTTP module 412       myAppConstants.properties 504
logs directory 550                ­module flag 59                   MyAsyncHandler 389­390
long readLong() 407               module XML 81, 561                MyLoggingHandler 390
LWP 465                             property replacement
LWP::Simple 467                        501­502                      N
                                    registering a generator 474
M                                   replace tags 497                named DOM elements 74
                                    user defined property             benefits 77
Massol, Vincent 57                     provider 521                 NamedFrame 134, 429, 431
Matisse 59                        module.nocache.js file 559­561    naming convention for widget
Maven 99                          module.nocache-xs.js file              styles 268
maxLength vs. TextBox width            559, 561                     native keyword 282
    property 432                  modules                           native, declaring method 9
maxResults 456                      class replacement due to        .NET 410
maybeStartModule() 572                 properties 332­333           Net::Http::get_response() 469
MD5 name, determining 571           defining properties 328         NetBeans 59, 63
592         INDEX




nocache-xs.js 558                  -out flag 56, 59                      insert() 161, 170
nontransient fields 358            outdent() 484                         onAttach() 163
noserver argument 87               -overwrite flag 53, 59                PopupPanel 164­165, 270
null pointer errors 94             overwriting existing                  RootPanel 158, 161, 171
NullPointerException 459                methods 484­485                  ScrollPanel 164, 168­170
                                                                         setting styling 159
O                                  P                                     simple panel, definition 162
                                                                         SimplePanel 164­170
OBFUSCATED option 90               Package Explorer 60                   StackPanel 174­175
Object readObject() 407            package names, restrictions 364       standard GWT 162­182
OBJECT tag 498                     package structure, creating 343       TabBar 181
objects, sending across            pageYOffset 293                       TabPanel 173, 181­182
     JavaScript-to-Java boundary   Panel class 162                       VerticalPanel 160­161,
     286­287                       Panel, Grid 138                          170, 177­178, 253
onBefore 232                       panels 12, 158                      _parent frame name 430
onBrowserEvent()                     AbsolutePanel 171                 parentMenu 423
     117, 145­146, 162, 203­208      add() 161, 170                    parkComponent 190
  handling sunk events 203           adding widgets 159                parse 445
  overriding 203                     adopt() 184                       password entry, securing 140
onClick() 78                         alignment 161                     PasswordTextBox 140, 433
onCompletion() 539                   as DOM elements 160­162           Perl 443
onError() 370                        as Java objects 159­160             using with JSON 465­467
onEventPreview() 190                 CellPanel 176                     permutations 94
onFailure() 370, 387                 ComplexPanel 162, 170­178           reducing number of for
onKeep() 312                         composite panel 162                    testing 562
onKeyPress() 141                     creating 182­187                  PHP 410
onLostFocus() 240                    creating by extending an exist-
                                                                       Pjax 393
onModuleLoad()                          ing panel 186­187
                                                                       PNGImage 147­148
     78, 80, 123, 227                creating for Dashboard
                                                                         onBrowserEvent() 150
onMouseDown() 207, 239                  187­190
onMouseDown(Widget sender,           creating from scratch               sinkEvents() 150
     int x, int y) 237                  183­185                        PNGImageImpl 149
onMouseEnter(Widget                  DeckPanel 170, 173­174            PNGImageImplIE6 149
     sender) 237                     DialogBox 164­166                 polling 392
onMouseLeave(Widget                  difference from widgets 163         comparison to blocking server
     sender) 237                     disown() 184                           threads 398
onMouseMove() 240                    DockPanel 175­177                   issues 392­393
onMouseMove(Widget sender,           extending, vs. composite            techniques 392­401
     int x, int y) 237                  widgets 182                    PopupListener 124, 232
onMouseUp(Widget sender,             FlexTable 179­180                   onPopupClosed() 232
     int x, int y) 237               FlowPanel 160, 173, 253           PopupPanel 164­165,
onResponseReceived() 422, 538        FocusPanel 164, 167­168                208, 231, 270
onSelected() 232                     FormPanel 164, 166­167            pop-ups, reacting to
onSink() 202                         getChildren() 170                      closing 231­232
onSuccess() 370, 387                 Grid 181                          POST 413­414, 456
onWindowClosed() 228                 HorizontalPanel                   prefetch() 128
onWindowCloseListener() 293             170, 177, 253                  PRETTY option 90
org.gwtbook 364                      HTML table panel 162              PrintWriter 483
organization 540                     HTMLPanel 172                     process() 400
organizing projects 540­548          HTMLTable 178­179                 production environment,
out argument 90, 96                  IndexedPanel 174                       configuring 550­552
                                                                                  INDEX         593



program code, as                 public attribute 51               RequestBuilder.GET 414
    JavaScript 576­578           public folder 364                 RequestBuilder.POST 414
project                          public tag 326                    RequestCallback 416, 538
  creating 47­50                 Pushlet 393                          onError() method 416
  importing into Eclipse 60­61                                        onResponseReceived()
  organizing 540­548             R                                      method 416
project files, separating from                                     RequestException 415
    other pages 544              radio buttons 434                 request-response cycle 411, 464
projectCreator 44, 47­48,        RadioButton 138­139, 434          resources, injecting at
    50, 91, 353                    grouping together 139                runtime 334­337
projectCreator tool 47           reader methods 406                Response
properties 495                   rebind 476                           checking status codes 416
  defining 328­330               rebind decision files,               getHeader() 417
  defining initial value 496          removing 541­542                getHeaders() 417
  defining new 328               reducing complexity 382              getHeadersAsString() 417
  definition in module           reflection 361                       getStatusText() 417
    XML 495­496                  refresh rate 393                  ResponseCallback 456
  determining value through      registering Generator class       Result property 453
    code 496                          333­334                      ResultSet 452
  extending 328­330              releaseCapture() 237, 239         right mouse clicks,
  extending in module            remote calls,                          capturing 206
    XML 495                           encapsulating 382­384        ROOT directory 551
  managing 327­332               Remote Procedure Call. See RPC    RootPanel 35, 80, 158,
  managing differences           remote server                          161, 171, 379
    330­332                        calling 368­370                 RootPanel.get() method 80
  user defined 520­523             restrictions for communicat-    RootPanel.get().add(widget/
  user specified 521                  ing with 351­353                  panel) 199
properties file 14               remote service call               RPC 16, 94, 111, 326, 348
  encoding 70                      making 370                         installing servlets 548­553
  format 69                      RemoteService interface              logging 391
  hierarchy 70                        361, 364, 368                   underlying concepts 348­356
  key/value separator 69           extending 361­362                  with RequestBuilder 414­417
  UTF-8 69                       RemoteServiceServlet              Ruby 443
property error function               363, 372, 553                   using with JSON 467­469
  registering 569­571            removeChangeListener 259          Ruby on Rails 29
property provider 330            removeMenu() 275                  RubyForge 467
  establishing 567­568           removing history files 543        RubyGems 467
  tag 496                         541                running tests 531­532
  user-specified 521­522         replacing class due to property   runtime errors 532
property replacement 501­502          values 332­333               RuntimeException 150, 262
PropertyOracle 479­480           Request
  getPropertyValue() 480           cancel() method 415             S
providing code to determine        checking status 415
    properties 330                 isPending() method 415          Scalar Vector Graphics 13
proxy 351, 461                     setting properties 414          schedulable class 395­398
proxy classes 361                request.getParameter() 415        schedule() 395
proxy object 366, 384            RequestBuilder 423, 439, 455      scheduleRepeating() 395
  casting to                       loading XML data 417­424        scheduling tasks 392­401
    ServiceDefTarget 368­369       RPC 414­417                     script.aculo.us 252
  creating 368                     sendRequest() method 415        Scriptaculous 341
proxy service 461                  with Ajax 410­424                 use in the Dashboard 341
594         INDEX




scrolling 168                       ServerService 363, 382­383        setSecondComponent() 153
ScrollListeners 224­226             server-side 4­6, 23               setServiceEntryPoint() 367­368
ScrollPanel 164, 168­170              classes 372                     setStyleName() 268
  ensureVisible() 169                 code 364                        setText() 166, 377
  setAlwaysShowScrollBars()           GWT-RPC 99, 360                 setTextLabel() 262
     169                              Java compliance 81, 415         setting application's entry
  setHorizontalPosition() 169         JSON 450                             point 337
  setScrollPosition() 169             logging information 103         setting path to public
search component, creating with       service implementation               resources 325
     JSON 450­460                        363­364, 371                 setting source code path
SearchResultsHandler 456              successful response 416              325­326
searchString 456                      testing functions 537­539       setUrl() 128
security 351                          throw exception 370             setVerticalAlignment() 161
_self 420, 429                      ServerStatsUpdater 385, 390       setVisibleItemCount(number)
sendRequest() 424                   ServerStatus 131, 232                  136
serializable data objects 371       ServerStatusComponent,            setWidget() 166, 190
  following rules for client-side        creating 378                 short readShort() 407
     code 358                       ServerStatusService_Proxy 366     simple panels, defined 162
SerializableException 363           ServerStatusServiceAsync 367      SimplePanel 164­170, 427
serialization 348, 402, 405         service implementation               add() 153
  custom, implementing                   363­365, 371                    insert() 153
     404­407                        service proxy 366, 372            Singleton pattern 382
  types supported by GWT 357        ServiceDefTarget 367­369          sinkEvent() 202
SerializationException 404­406      services                          sinkEvents() 145, 147
SerializationStreamReader             calling from client 372­374     sinking events 197, 200­203
     404­406                          server-side                     sleep command 399
SerializationStreamWriter 405            implementation 371­372       Slider
serialize() 403, 405­406             365, 550                   creating 270­273
serializers                         servlet configuration 549­550        GridSlider 273
  class 403­404                     servlet containers 548­549, 552      HorizontalSlider 273
  custom 402­407                      Apache Tomcat 548                  onMouseDrag() 271
  custom, class rules 403           servlet path setting 365             VerticalSlider 273
  custom, reasons to write 402      servlet tag 365                   slider index 272
server                              ServletFileUpload 438             Slideshow 119, 128
  contacting 348                    ServletFileUpload.isMultipart-    software patterns 376
  implementing blocking                  Content 438                  source attribute 51
     399­401                         553             SourceKeyboardEvents 252
server package 365                  servlets 326, 463                 SourcesChangeEvents
server proxy 462                      configuration file 549               220, 256, 272
server resources, defining for an     mapping to URL 553              SourcesClickEvents 212­213,
     application 326­327              RPC, installing 548­553              252, 256
Server Status 234, 348, 552         Set 362                              checking for instanceof 262
  creating 353­356                  setAutoOpen() 123                    required methods 259
  encapsulating 376­382             setCancelled() 428                SourcesEvents 214
  encapsulation 376                 setCapture() 237                  SourcesMouseEvents 211, 256
  updating 393                      setElement() 114                     required methods 259
server threads                      setHorizontalAlignment() 161      SourceWriter 478, 482
  blocking 398­401                  setHTML() 166                     sprintf() 466
server-push 351, 392­393            setName() 427                     StackPanel() 174­175
  emulating 398­401                 setOnKeepCallback() 313              getSelectedIndex() 175
  unavailable to browsers 398       setPopupPosition() 238               setStackText() 175
                                                                                   INDEX        595



stale connections 401               assertFalse() 530                   setCursorPos() 139
standard applications 566­567       assertNotNull() 530                 setText() 139
   bootstrapping 567­572            assertNull() 530                 theLabel.setWidth() 131
startUpdateTimer() 396­397          assertSame() 530                 third-party libraries 13
static-string                       available assertions 530            altering module XML file 341
      internationalization          creating new 534­537                changing necessary
      503­516                       fail() 530                             classpaths 340
status codes, checking 416          failSame() 531                      JavaScript, accessing 278
stdin 468                           setUp() 533                         using 339­341
stopUpdateTimer() 397               tearDown() 533                   Thread.sleep() 400
String readString() 407             writing 529­531                  timed events 394
stringValue() 446, 460           test-driven development 528