Table of Contents

Copyright

Brief Table of Contents

Table of Contents

Foreword

Preface

Acknowledgments

About this Book

About the Cover Illustration

1. Getting started

Chapter 1. Welcome to the Griffon revolution

1.1. Introducing Griffon

1.1.1. Setting up your development environment

1.1.2. Your first Griffon application

1.2. Building the GroovyEdit text editor in minutes

1.2.1. Giving GroovyEdit a view

1.2.2. Making the menu items behave: the controller

1.2.3. How about a tab per file?

1.2.4. Making GroovyEdit functional: the FilePanel model

1.2.5. Configuring the FilePanel controller

1.3. Java desktop development: welcome to the jungle

1.3.1. Lots of boilerplate code (ceremony vs. essence)

1.3.2. UI definition complexity

1.3.3. Lack of application life cycle management

1.3.4. No built-in build management

1.4. The Griffon approach

1.4.1. At the core: the MVC pattern

1.4.2. The convention-over-configuration paradigm

1.4.3. Groovy: a modern JVM language

1.5. Summary

Chapter 2. A closer look at Griffon

2.1. A tour of the common application structure

2.2. The ABCs of configuration

2.2.1. A is for Application

2.2.2. B is for Builder

2.2.3. C is for Config

2.3. Using Griffon’s command line

2.3.1. Build command targets

2.3.2. Run command targets

2.3.3. Miscellaneous command targets

2.4. Application life cycle overview

2.4.1. Initialize

2.4.2. Startup

2.4.3. Ready

2.4.4. Shutdown

2.4.5. Stop

2.5. Summary

2. Essential Griffon

Chapter 3. Models and binding

3.1. A quick look at models and bindings

3.1.1. Creating the project

3.1.2. Creating the model

3.1.3. Creating the view

3.1.4. Creating the controller

3.2. Models as communication hubs

3.2.1. MVC in the age of web frameworks

3.2.2. Rethinking the pattern

3.3. Observable beans

3.3.1. JavaBeans bound properties: the Java way

3.3.2. JavaBeans bound properties: the Groovy way

3.3.3. Handy bound classes

3.4. Have your people call my people: binding

3.4.1. A basic binding call

3.4.2. The several flavors of binding

3.4.3. Finding the essence

3.4.4. Other binding options

3.5. The secret life of BindingUpdatable

3.5.1. Keeping track of bindings with the BindingUpdatable object

3.5.2. Managing the bindstorm: bind(), unbind(), and rebind()

3.5.3. Manually triggering a binding: update() and reverseUpdate()

3.5.4. Grouping bindings together

3.6. Putting it all together

3.6.1. Setting up the model

3.6.2. Defining a view

3.6.3. Adding the missing validations to the model

3.7. Summary

Chapter 4. Creating a view

4.1. Java Swing for the impatient

4.1.1. “Hello World” the Swing way

4.1.2. Extending “Hello World”: “Hello Back”

4.1.3. Swing observations

4.2. Groovy SwingBuilder: streamlined Swing

4.2.1. “Hello World” the SwingBuilder way

4.2.2. “Hello Back” with SwingBuilder

4.3. Anatomy of a Griffon view

4.3.1. Builders are key to views

4.3.2. Nodes as building blocks

4.4. Using special nodes

4.4.1. Container

4.4.2. Widget

4.4.3. Bean

4.4.4. Noparent

4.4.5. Application

4.5. Managing large views

4.5.1. Rounding up reusable code

4.5.2. Breaking a large view into scripts

4.5.3. Organize by script type

4.6. Using screen designers and visual editors

4.6.1. Integrating with the NetBeans GUI builder (formerly Matisse)

4.6.2. Integrating with Abeille Forms Designer

4.7. Summary

Chapter 5. Understanding controllers and services

5.1. Dissecting a controller

5.1.1. Quick tour of injected properties and methods

5.1.2. Using the post-initialization hook

5.1.3. Understanding controller actions

5.2. The need for services

5.2.1. Creating a simple service

5.2.2. Creating a Spring-based service

5.3. Artifact management

5.3.1. Inspecting artifacts

5.3.2. Metaprogramming on artifacts

5.3.3. Artifact API in action

5.4. Summary

Chapter 6. Understanding MVC groups

6.1. Anatomy of an MVC group

6.1.1. A look at each member

6.1.2. Registering the MVC group

6.1.3. Startup groups

6.2. Instantiating MVC groups

6.2.1. Creation methods

6.2.2. Marshaling the MVC type instances

6.2.3. Initializing group members

6.2.4. Advanced techniques

6.3. Using and managing MVC groups

6.3.1. Accessing multiple MVC groups

6.3.2. Destroying MVC groups

6.4. Creating custom artifact templates

6.4.1. Templates, templates, templates

6.4.2. It’s alive!

6.5. Summary

Chapter 7. Multithreaded applications

7.1. The bane of Swing development

7.1.1. Java Swing without threading

7.1.2. Java Swing with threading

7.2. SwingBuilder alternatives

7.2.1. Groovy Swing without threading

7.2.2. Groovy Swing with threading

7.2.3. Synchronous calls with edt

7.2.4. Asynchronous calls with doLater

7.2.5. Outside calls with doOutside

7.3. Multithreaded applications with Griffon

7.3.1. Threading and the application life cycle

7.3.2. Threading support the Griffon way

7.3.3. Controller actions and multithreading: a quick guide

7.3.4. Fine-tuning threading injection

7.3.5. What about binding?

7.4. SwingXBuilder and threading support

7.4.1. Installing SwingXBuilder

7.4.2. The withWorker() node

7.5. Putting it all together

7.5.1. Defining the application’s outline

7.5.2. Setting up the UI elements

7.5.3. Defining a tab per loading technique

7.5.4. Adding the loading techniques

7.5.5. FileViewer: the aftermath

7.6. Additional threading options

7.6.1. Synchronous calls in the UI thread

7.6.2. Asynchronous calls in the UI thread

7.6.3. Executing code outside of the UI thread

7.6.4. Is this the UI thread?

7.6.5. Executing code asynchronously

7.7. Summary

Chapter 8. Listening to notifications

8.1. Working with build events

8.1.1. Creating a simple script

8.1.2. Handling an event with the events script

8.1.3. Publishing build events

8.2. Working with application events

8.2.1. E is for events

8.2.2. Additional application event handlers

8.2.3. Firing application events

8.3. Your class as an event publisher

8.3.1. A basic Marco-Polo game

8.3.2. Running the application

8.4. Summary

Chapter 9. Testing your application

9.1. Griffon testing basics

9.1.1. Creating tests

9.1.2. Running tests

9.1.3. Testing in action

9.2. Not for the faint of heart: UI testing

9.2.1. Setting up a UI component test

9.2.2. A hands-on FEST example

9.3. Testing with Spock and easyb

9.3.1. Spock reaches a new level

9.3.2. FEST-enabled Spock specifications

9.3.3. easyb eases up BDD

9.4. Metrics and code inspection

9.4.1. Java-centric tools: JDepend and FindBugs

9.4.2. Reporting Groovy code violations with CodeNarc

9.4.3. Measuring Groovy code complexity with GMetrics

9.4.4. Code coverage with Cobertura

9.5. Summary

Chapter 10. Ship it!

10.1. Understanding the common packaging options

10.2. Using Griffon’s standard packaging targets

10.2.1. The jar target

10.2.2. The zip target

10.2.3. The applet and webstart targets

10.2.4. Customizing the manifest

10.2.5. Customizing the templates

10.3. Using the Installer plugin

10.3.1. Building a distribution

10.3.2. The izpack target

10.3.3. The rpm target

10.3.4. The deb target

10.3.5. The mac target

10.3.6. The jsmooth target

10.3.7. The windows target

10.3.8. Tweaking a distribution

10.4. Summary

Chapter 11. Working with plugins

11.1. Working with plugins

11.1.1. Getting a list of available plugins

11.1.2. Getting plugin-specific information

11.1.3. Installing a plugin

11.1.4. Uninstalling a plugin

11.2. Understanding plugin types

11.2.1. Build-time plugins

11.2.2. Runtime plugins

11.3. Creating the Tracer plugin and addon

11.3.1. Bootstrapping the plugin/addon

11.3.2. Intercepting property updates

11.3.3. Using the plugin

11.3.4. Intercepting action calls

11.3.5. Running the plugin again

11.4. Releasing the Tracer plugin

11.5. Summary

Chapter 12. Enhanced looks

12.1. Adding new nodes

12.1.1. Registering node factories

12.1.2. Using an implicit addon

12.1.3. Creating a builder

12.2. Builder delegates under the hood

12.2.1. Acting before the node is created

12.2.2. Tweaking the node before properties are set

12.2.3. Handling node properties your way

12.2.4. Cleaning up after the node is built

12.3. Quick tour of builder extensions in Griffon

12.3.1. SwingXBuilder

12.3.2. JideBuilder

12.3.3. CSSBuilder

12.3.4. GfxBuilder

12.3.5. Additional builders

12.4. Summary

Chapter 13. Griffon in front, Grails in the back

13.1. Getting started with Grails

13.2. Building the Grails server application

13.2.1. Creating domain classes

13.2.2. Creating the controllers

13.2.3. Running the Bookstore application

13.3. To REST or not

13.3.1. Adding controller operations

13.3.2. Pointing to resources via URL

13.4. Building the Griffon frontend

13.4.1. Setting up the view

13.4.2. Updating the model

13.5. Querying the Grails backend

13.5.1. Creating a service

13.5.2. Injecting an instance of the service

13.5.3. Configuring the Bookstore application

13.6. Alternative networking options

13.7. Summary

Chapter 14. Productivity tools

14.1. Getting set up in popular IDEs

14.1.1. Griffon and Eclipse

14.1.2. Griffon and NetBeans IDE

14.1.3. Griffon and IDEA

14.1.4. Griffon and TextMate

14.2. Command-line tools

14.2.1. Griffon and Ant

14.2.2. Griffon and Gradle

14.2.3. Griffon and Maven

14.3. The Griffon wrapper

14.4. Summary

Appendix Porting a legacy application

Handling legacy views

Swing GUI Builder views

Abeille Forms Designer views

Custom Java-based views

XML-based views

Full Java MVC members

Preferring services over controllers

Using events to your advantage

Index

List of Figures

List of Tables

List of Listings

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.55.198