Getting Further with Spring RCP
At the end of this article, the following new classes will have been created, on top of those created in the earlier article:
When deployed, the application will look as follows, presenting data in a Spring RCP "AbstractObjectTable" displayed in a Spring RCP "AbstractView", which is the Customer View that you created in the first article:
Indeed, the application you will build via this article will be very similar to the simple example that is bundled with the Spring RCP distribution. It will, in fact, be a subset of that example. (And many of the insights and comments in this article come from the comments in that example.) The domain objects will be much more limited than those provided by the example, as will the functionality you will add to the application, so that you will be able to focus on some very specific aspects. For example, you will learn how to add a popup item to the table, via a Spring RCP "CommandGroup", as shown below:
When the popup item is selected, a Spring RCP "TitledPageApplicationDialog" will be displayed. The dialog will be backed by a Spring RCP "AbstractForm", constructed by means of a Spring RCP "TableFormBuilder". A Spring RCP "DefaultRulesSource" will be used to ensure that, for example, the user will not be able to set a name with less than two characters, as shown below:
Again, all of these items are purely optional. Ignore them if you have your own alternatives. However, it's handy to know what's available and, potentially, one or more of these features might pique your interest and be relevant within your own Spring RCP applications.
Table of Contents
- Creating the Domain Objects
- Creating a Table
- Adding Functionality to the Table
- Creating a Dialog
- Using the Form Builder
- Adding Rules Based Validation
By the end of this article, you should have a general idea about what the topics above mean and how they relate to Spring RCP. Hopefully, you'll have enough information to begin playing with these features yourself!
Note: The completed example is available as a NetBeans project, as part of the Spring RCP Tooling plugin in the NetBeans Plugin Portal, from version 1.3 of the plugin onwards. Open the New Project wizard (Ctrl-Shift-N) and you should find "Spring RCP Tutorial Part 1" in the "Samples | Spring Rich Client" category.
Before continuing, make sure you have a Spring RCP application, in the state reached by the end of the second part of "Getting Started with Spring RCP", i.e., Creating a View. That is, you must be able to successfully run your Spring RCP application and display an empty "AbstractView" class, which is assumed to be called "CustomerView", in the instructions that follow. We will display our table in the "AbstractView" class, so it is important that you have one ready to be used.