This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Simplest Spring-RC application

Aug 17th, 2005, 11:51 PM

Hi all!
Recently I've started learning Spring-RC, so I've faced with some start-up problems. So problems are resoleved, and I want to share the simplest Spring-RC application possible.
It's
Hope it will help somebody.

Next thing is XML-configs. It is nothing, but spring managed beans.
Splash screen configuration. It's mentioned in launcher class (Main). This is not essential, but it looks cool, when splash screen is shown while whole program is being loaded.

This is application configuration, it's also mentioned in Main.java and defines the application itself. Mainly it's designated for defining resources such as messages, icons, images and so on. Also it defines views, available in application. Here defined starting view - MainView.

Comment

When I run the sample, the splash screen and then the main view come up, but I do not get a menu bar in the main view. What I do see is "displayName" near the top of the view and "Hello, world!" in the middle, but no menu bar. Any ideas as to what I am overlooking?

Comment

When I run the sample, the splash screen and then the main view come up, but I do not get a menu bar in the main view. What I do see is "displayName" near the top of the view and "Hello, world!" in the middle, but no menu bar. Any ideas as to what I am overlooking?

The most likely you have not configured message source properly, so RC don't know how to label your menu bar items.

Comment

There is also a sample RCP application in the last chapter of "Spring, A Developer's Notebook" from O'Reilly.

I have this book and find the example in the last chapter a bit wanting. The last chapter does not address most of the nitty gritty details involved with creating a rich client app using Spring RCP, and certainly does not address the questions in my previous post. The companion web site includes sample code for the book, but not for the example in the last chapter. Basically the book raises more questions about using Spring RCP than it answers.

Once you have the projects imported into your favorite IDE, I would recommend running the "Simple" sample and studying it. With .3, "simple" is even simpler--the simplest possible Spring Rich app you'll come across. A good starting point.

Comment

Thank you for posting this example. I am using it as a starting point to understand Spring RCP.

1. How do I change the "displayName" text to my own value?
2. If I wanted to eliminate the title bar in the view, how would I do that?
3. How do I specifiy a different look and feel with the example?

I suspect the original poster of these questions is no longer interested in the answers (since the date was more than a year ago). However, since I found this thread while trying to answer the same questions, I wanted to post the answers I found.

The first couple of beans are new to snapshot 0.2.1. Previously, magic bean names (like "messageSource") were used by the framework. Now, the ApplicationServices and ApplicationServicesLocator bean collaborate to accomplish the same thing.

The applicationObjectConfigurer is particularly important in this context, since it appears to form the wiring between message properties of components in the UI and the messages.properties file.

With these additional beans defined, you can set the label for the mainView UI component in the messages.properties file, like this: