Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated to RWT 2.0 M3. Update documentation. First 0.1 release.

  • Loading branch information...
commit 00bef0187db637d751aaf473893342162ae0cb8f 1 parent 3644b5d
@bwolff authored
Showing with 154 additions and 41 deletions.
  1. +6 −3 README.md
  2. +0 −1  RwtGrailsPlugin.groovy
  3. BIN  lib/org.eclipse.core.runtime_3.8.0.v20120521-2346.jar
  4. BIN  lib/org.eclipse.core.runtime_3.9.0.v20121004-163638.jar
  5. BIN  lib/org.eclipse.rap.jface_2.0.0.20121001-1623.jar
  6. BIN  lib/org.eclipse.rap.jface_2.0.0.20121031-1050.jar
  7. BIN  lib/org.eclipse.rap.rwt_2.0.0.20121001-1623.jar
  8. BIN  lib/org.eclipse.rap.rwt_2.0.0.20121112-1148.jar
  9. +2 −3 src/docs/guide/advancedTopics.gdoc
  10. +10 −1 src/docs/guide/configuration.gdoc
  11. +1 −1  src/docs/guide/configuration/applicationConfiguration.gdoc
  12. +37 −1 src/docs/guide/configuration/entryPointConfiguration.gdoc
  13. +1 −2  src/docs/guide/configuration/loggingConfiguration.gdoc
  14. +22 −2 src/docs/guide/gettingStarted.gdoc
  15. +17 −8 src/docs/guide/gettingStarted/configureEntryPoint.gdoc
  16. +32 −7 src/docs/guide/gettingStarted/createEntryPoint.gdoc
  17. +8 −5 src/docs/guide/gettingStarted/deployApplication.gdoc
  18. +7 −4 src/docs/guide/gettingStarted/installation.gdoc
  19. +2 −1  src/docs/guide/gettingStarted/runApplication.gdoc
  20. +1 −1  src/docs/guide/introduction.gdoc
  21. +8 −1 src/docs/guide/introduction/knownIssues.gdoc
View
9 README.md
@@ -1,7 +1,10 @@
grails-rwt
==========
-The first alpha release is there! It works, but I'm still finishing the documentation before I'll
-release the plugin into the official Grails plugin repository.
+This plugin integrates RWT - the web-ported Standard Widget Toolkit (SWT) - into your Grails
+application. It enables you to build your RWT and JFace powered user interfaces using Groovy and the
+complete Grails framework stack with all its powerful features and syntactic DSL sugar.
-Stay tuned!!
+The RWT plugin is available here: http://grails.org/plugin/rwt
+
+The documentation is available here: http://bwolff.github.com/grails-rwt/
View
1  RwtGrailsPlugin.groovy
@@ -15,7 +15,6 @@ complete Grails framework stack with all its powerful features and syntactic DSL
'''
def documentation = "http://bwolff.github.com/grails-rwt/"
-
def license = "APACHE"
def issueManagement = [ system: "github", url: "https://github.com/bwolff/grails-rwt/issues" ]
def scm = [ url: "https://github.com/bwolff/grails-rwt/" ]
View
BIN  lib/org.eclipse.core.runtime_3.8.0.v20120521-2346.jar
Binary file not shown
View
BIN  lib/org.eclipse.core.runtime_3.9.0.v20121004-163638.jar
Binary file not shown
View
BIN  lib/org.eclipse.rap.jface_2.0.0.20121001-1623.jar
Binary file not shown
View
BIN  lib/org.eclipse.rap.jface_2.0.0.20121031-1050.jar
Binary file not shown
View
BIN  lib/org.eclipse.rap.rwt_2.0.0.20121001-1623.jar
Binary file not shown
View
BIN  lib/org.eclipse.rap.rwt_2.0.0.20121112-1148.jar
Binary file not shown
View
5 src/docs/guide/advancedTopics.gdoc
@@ -1,4 +1,4 @@
-h3. URL Mapping of Entry Points
+h3. Custom URL Mapping of Entry Points
By default RWT entry points are mapped to their name under the applications base URL. If the
application name would be 'foo' and the entry point name 'hello', the URL would look like this:
@@ -13,9 +13,8 @@ file:
class UrlMappings {
static mappings = {
- ...
+
"/"(uri: "/hello")
- ...
}
}
{code}
View
11 src/docs/guide/configuration.gdoc
@@ -1 +1,10 @@
-Configuration...
+The RWT application goes into a special configuration block in the @Config.groovy@ file.
+
+{code}
+rwt {
+ // RWT configuration goes here.
+}
+{code}
+
+There are two aspects that can be configured, the global RWT settings, and the settings
+specific to the single entry points.
View
2  src/docs/guide/configuration/applicationConfiguration.gdoc
@@ -1 +1 @@
-Application configuration...
+Options to configure global aspects of the RWT application will come in future versions of this plugin.
View
38 src/docs/guide/configuration/entryPointConfiguration.gdoc
@@ -1 +1,37 @@
-EntryPoint configuration...
+An RWT application can consist of one or more entry points. Each entry point is configured as a
+configuration block within the @rwt@ section.
+
+{code}
+rwt {
+ hello {
+ bean = 'entryPointBean'
+ pageTitle = 'Hello RWT World!'
+ }
+}
+{code}
+
+The given example configures an entry point with the name @hello@. By default, this entry point will
+be mapped to the relative URL path '/hello'. The following settings need to be provided for an
+entry point configuration:
+
+* *bean* - The name (string) of the bean that implements the IEntryPoint interface (mandatory).
+* *pageTitle* - The title (string) that will be displayed as the browser's title (optional).
+
+A Grails-RWT application can contain an arbitrary number of entry points, which usually refer to
+different entry point beans.
+
+{code}
+rwt {
+ hello {
+ bean = 'helloEntryPoint'
+ pageTitle = 'Hello RWT World!'
+ }
+
+ helloAgain {
+ bean = 'helloAgainEntryPoint'
+ pageTitle = 'Hello again, RWT World!'
+ }
+}
+{code}
+
+In this example there will be two entry points accessible under '/hello' and '/helloAgain'.
View
3  src/docs/guide/configuration/loggingConfiguration.gdoc
@@ -4,10 +4,9 @@ the [log4j section|http://grails.org/doc/latest/guide/conf.html#logging] in your
{code}
log4j = {
- ...
+
debug 'grails.app.conf.RwtPluginBootStrap'
debug 'grails.plugins.rwt'
debug 'RwtGrailsPlugin'
- ...
}
{code}
View
24 src/docs/guide/gettingStarted.gdoc
@@ -1,3 +1,23 @@
-Getting started...
+This short guide will get you started with all you need to know to create your first Grails-RWT
+application. You should be familiar with how to [create a Grails application|http://grails.org/doc/latest/guide/gettingStarted.html#creatingAnApplication]
+and artifacts like [domain classes|http://grails.org/doc/latest/guide/GORM.html#quickStartGuide] and
+[services|http://grails.org/doc/latest/guide/services.html].
-This plugin requires at least Grails version 2.0.
+The RWT setup process is based on the [standalone guide|http://eclipse.org/rap/developers-guide/devguide.php?topic=advanced/rwt-standalone.html].
+However, the Grails-RWT plugin does most of the setup for you, as you will see in this guide.
+
+Start with creating an example Grails application and then follow the instructions below. The next
+sections assume that the applications is called @grails-rwt-example@. Replace the occurences in the example
+URLs with the actual name of your example application.
+
+h3. Example Code
+
+There is an example project available on GitHub that can be used as a kickstart. It contains the
+example code shown in this guide and is properly configured to get started immediately.
+
+{code}
+git clone https://github.com/bwolff/grails-rwt-example
+{code}
+
+After you checked out the project you can inspect the code and start the application as described
+in the [Running the Application|guide:runApplication] section below.
View
25 src/docs/guide/gettingStarted/configureEntryPoint.gdoc
@@ -1,17 +1,26 @@
-Configure entry point ...
+The only thing that is missing now is the configuration of our new RWT entry point. This is done
+in an own [configuration|http://grails.org/doc/latest/guide/conf.html#config] block in the
+@Config.groovy@ file.
{code}
-// The RWT configuration block
+// RWT configuration
rwt {
- // Entry Point configuration block
+ // Entry points configuration
entrypoints {
-
- // Configuration of an entry point named 'hello'
+
+ // Configuration of an entry point named 'hello', the relative URL path will be '/hello'.
hello {
- bean = 'helloEntryPointService'
- pageTitle = 'Hello RWT!'
+ bean = 'helloEntryPointService' // The name of the entry point bean (required)
+ pageTitle = 'Hello RWT!' // The browser title that will be displayed (optional)
}
}
}
-{code}
+{code}
+
+Here we simply specify our entry point as a block under @entrypoints@ and provide the name of the
+entry point bean, which is described above. We can also specify a string that will be displayed as
+the browser's page title.
+
+More information about the configuration of an RWT application and the entry points is available
+[here|guide:configuration].
View
39 src/docs/guide/gettingStarted/createEntryPoint.gdoc
@@ -1,6 +1,18 @@
-Create entry point ...
+The first step is to create a so called RWT _entry point_ class. An instance of this class needs to
+be registered as a Spring bean to be picked up by the RWT configuration. The
+suggested approach is to use a Grails [service|http://grails.org/doc/latest/guide/services.html]
+for that. Being a Grails artifact, a service is registered as a Spring bean by default
+and other dependencies and functionalities are added/injected out of the box.
+
+The following code snippet shows an example entry point service implementation
+(in the @grails-app/services@ sub-folder). To demonstrate the usage,
+another service (@FooService@) and a domain class (@Foo@) are used. They don't do anything useful and
+their code can be obtained from the example application, as described above. The comments in the code
+snippet highlight interesting points.
{code}
+package grails.rwt.example
+
import org.eclipse.jface.viewers.ArrayContentProvider
import org.eclipse.jface.viewers.LabelProvider
import org.eclipse.jface.viewers.ListViewer
@@ -16,6 +28,8 @@ import org.eclipse.swt.widgets.Label
import org.eclipse.swt.widgets.List
import org.eclipse.swt.widgets.Shell
+// "Note the use of Groovy syntax"
+
class HelloEntryPointService implements IEntryPoint { // "The service needs to implement IEntryPoint"
def fooService // "Other services will get injected by Grails"
@@ -26,24 +40,27 @@ class HelloEntryPointService implements IEntryPoint { // "The service needs to i
Shell shell = new Shell(display)
shell.setSize(500, 400)
shell.layout = new GridLayout()
+ shell.setText("Hello RWT!")
- Label label = new Label(shell, SWT.NONE)
- label.text = fooService.serviceMethod() // "Call methods of other services"
+ final Label label = new Label(shell, SWT.NONE)
+ label.layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false)
// "JFace is available"
ListViewer viewer = new ListViewer(shell, SWT.V_SCROLL | SWT.H_SCROLL)
viewer.list.layoutData = new GridData(SWT.FILL, SWT.FILL, true, true)
viewer.contentProvider = ArrayContentProvider.instance
viewer.labelProvider = new LabelProvider()
- viewer.input = Foo.list() // "Use domain objects and GORM, no DTOs required!"
+ viewer.input = Foo.list() // "Use domain objects and GORM directly, no DTOs required!"
Button button = new Button(shell, SWT.PUSH)
button.layoutData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false)
- button.text = "Hello!"
+ button.text = "Click me!"
button.addSelectionListener(new SelectionAdapter() {
+ Integer num = 0
+
@Override
public void widgetSelected(SelectionEvent e) {
- println "Hello RWT!"
+ label.text = fooService.serviceMethod(num++) // "Call methods of other services"
}
})
@@ -51,4 +68,12 @@ class HelloEntryPointService implements IEntryPoint { // "The service needs to i
return 0
}
}
-{code}
+{code}
+
+According to the Grails conventions, a Spring bean called @helloEntryPointService@ will be registered
+automatically on application start. The next step is to configure our newly create entry point.
+
+{note}
+The given code snippet is just a very simple example to demonstrate the usage. You should develop
+your application using a cleaner separation of concerns, i.e. by employing the MVC or MVP pattern.
+{note}
View
13 src/docs/guide/gettingStarted/deployApplication.gdoc
@@ -1,12 +1,15 @@
-You can now package your first Grails/RWT application into a WAR file and deploy to the servlet
+You can now package your application into a WAR file and deploy it to the [servlet container|http://grails.org/Deployment]
of your choice. The [deployment procedure|http://grails.org/doc/latest/guide/deployment.html] is the
-same as for any other Grails application, by simply issuing the following command in the command
+same as for a default Grails application, by simply issuing the following command in the command
line:
{code}
grails war
{code}
-The resulting WAR file is created in the @target/@ folder and can now be deployed to e.g. a [Tomcat|http://tomcat.apache.org/]
-container. All necessary jar files for RWT/JFace will be contained and the web.xml is also properly
-set up.
+The resulting WAR file is created in the @target/@ sub-folder and can now be deployed to e.g. a
+[Tomcat|http://tomcat.apache.org/] container. All necessary jar files for RWT/JFace will be
+packaged and the web.xml will also be properly set up.
+
+Congratulations! You should now be able to create a more sophisticated Grails-RWT applications and
+explore the features that RWT provides.
View
11 src/docs/guide/gettingStarted/installation.gdoc
@@ -1,12 +1,15 @@
The plugin is installed using the default [Grails plugin installation mechanism|http://grails.org/doc/latest/guide/conf.html#pluginDependencies].
-Simply add the following lines to the plugin dependency section in the @BuildConfig.groovy@ file:
+Simply add/modify the following lines to the plugin dependency section in the @BuildConfig.groovy@ file:
{code}
grails.project.dependency.resolution = {
- ...
+
plugins {
compile ':rwt:0.1'
}
- ...
}
-{code}
+{code}
+
+The plugin will be installed automatically on the next invocation of a Grails command. Your IDE
+(e.g. [STS/GGTS|http://grails.org/products/ggts]) should also pick up the new installed plugin and should make the contained jar
+libraries available in your Grails project.
View
3  src/docs/guide/gettingStarted/runApplication.gdoc
@@ -6,4 +6,5 @@ command line in the project root folder:
grails run-app
{code}
-After the application started you should be able to access your first Grails/RWT example under the following URL: @http://localhost/foo/hello@
+After the application has been started you should be able to access your first Grails-RWT example under the
+following URL: @http://localhost:8080/grails-rwt-example/hello@
View
2  src/docs/guide/introduction.gdoc
@@ -24,7 +24,7 @@ RWT. Have fun!
h3. RWT Version
-The current version of this plugin comes with the [RWT/JFace version 2.0 M3|http://www.eclipse.org/rap/noteworthy/2.0/?build=M3].
+The current version of this plugin comes with [RWT 2.0 M3|http://www.eclipse.org/rap/noteworthy/2.0/?build=M3].
h3. License
View
9 src/docs/guide/introduction/knownIssues.gdoc
@@ -1 +1,8 @@
-Known and open issues...
+This section sums up a few issues that will be tackled/resolved in upcoming versions of this plugin.
+
+* *Theming & Branding*
+** Support the RWT custom CSS and theming options.
+* *Use Maven for the RWT dependencies*
+** Unfortunately there is no maven repository available that can server the required RWT dependency jar files. Currently, the required jars are bundled with the plugin. This is no ideal, as it doesn't allow to switch the RWT version. This situation can be improved if the jar files will become available in a public Maven repository.
+
+Please file any issues/requests/ideas in the [GitHub issue tracker|http://github.com/bwolff/grails-rwt/issues].
Please sign in to comment.
Something went wrong with that request. Please try again.