I wanted to post how I got Spring to use AspectJ for DI in Eclipse RCP applications. The post won't happen as I wrote an article about it for the German Eclipse Magazin. As soon as the article is out you will find a link to it in here.
Showing posts with label eclipse rcp. Show all posts
Showing posts with label eclipse rcp. Show all posts
Wednesday, December 10, 2008
Sunday, November 23, 2008
OSGi + Spring = ?
It took me a while to get back to my beloved Spring.
Before I start raving about this great framework some intro why I am doing this.
Dependency Injection is one of my most beloved patterns. It removes a lot of boilerplate code from your software if correctly applied.
When we started the Designer project we were looking into spring-osgi but decided to wait for the first final release to incorporate it.
Lookign back I don't know if that was the best way to go. We had to implement our own DI-Service in OSGi. So far it has worked pretty good but with a growing project you want get rif od as many headaches as possible.
One headache is that now almost all aspects of Rifidi are using our custom DI-Service and that means we have to deal with new features (unbelievable, some people really want software to evolve).
It would be great to get replace it with Spring-DM (the Spring OSGi project).
So today is the great day:
I will try to get services injected into an eclipse view.
Things accomplished this morning:
Before I start raving about this great framework some intro why I am doing this.
Dependency Injection is one of my most beloved patterns. It removes a lot of boilerplate code from your software if correctly applied.
When we started the Designer project we were looking into spring-osgi but decided to wait for the first final release to incorporate it.
Lookign back I don't know if that was the best way to go. We had to implement our own DI-Service in OSGi. So far it has worked pretty good but with a growing project you want get rif od as many headaches as possible.
One headache is that now almost all aspects of Rifidi are using our custom DI-Service and that means we have to deal with new features (unbelievable, some people really want software to evolve).
It would be great to get replace it with Spring-DM (the Spring OSGi project).
So today is the great day:
I will try to get services injected into an eclipse view.
Things accomplished this morning:
- Target platform is up and running (will be up in Rifidi subversion as soon as I am done fighting with it)
- Services get deployed to OSGi
- Dependencies get injected (right now using xml config files)
- Get AOP up and running.
- Inject services using annotations
- Get a view injected with a service
Saturday, November 24, 2007
Chopped off arm, body is healthy
Yep, it was a very, very hard decision.
Today i finalized the removal of Common Navigator from Designer.
Probably one of the toughest decision I had to make so far.
CNF is an awesome framework but the lack of good documentation makes it quite a task to use it.
I got everything to work, with one exception:
Non objectContribution contributed actions.
Getting your actions to show up in the CNF popup based on the selected object(s) is a piece of cake.
Everything else is a completely different story.
I followed the instructions on digital paper napkin up to that point of adding stuff using action providers.
And there it failed. I dodn't know what I did wrong, I got the demo sourcecode, got the same exception: "Incorrect number of expressions: enablement in navigator extension: null in plugin"
A quick googling showed me that some other people hit that problem but no answers so far.
That did it and for now we will live without CNF.
I still hope to get it back in some time but right now we are back to old fashioned RCP.
Today i finalized the removal of Common Navigator from Designer.
Probably one of the toughest decision I had to make so far.
CNF is an awesome framework but the lack of good documentation makes it quite a task to use it.
I got everything to work, with one exception:
Non objectContribution contributed actions.
Getting your actions to show up in the CNF popup based on the selected object(s) is a piece of cake.
Everything else is a completely different story.
I followed the instructions on digital paper napkin up to that point of adding stuff using action providers.
And there it failed. I dodn't know what I did wrong, I got the demo sourcecode, got the same exception: "Incorrect number of expressions: enablement in navigator extension: null in plugin"
A quick googling showed me that some other people hit that problem but no answers so far.
That did it and for now we will live without CNF.
I still hope to get it back in some time but right now we are back to old fashioned RCP.
Tuesday, November 20, 2007
Leg, Arm, Head
What would you be willing to lose?
I am sitting here, after weeks of coding with the CommonNavigator framework in eclipse, just to realize that I might have to completely remove it or lose the last tiny shard of sanity left in my head.
Yes, CommonNavigator is awesome, somewhat.
The absolute absence of debugging help in it is just frustrating.
Not knowing what is wrong with your XMl and not getting any help from eclipse is rather frustrating.
By googling a little you will discover pretty soon that I am not the only person who is unable to get actions to show in the places you actually want em to show up.
By now I think I got a pretty good grasp on eclipse and the dreaded toolBar/menuBar-paths.
I even understand how the objectContributions work.
But the vieweContribution stuff is a complete mystery to me.
Seems like as if I will have to read some source code to figure out what I am doing wrong.
Would it really be that hard to provide some help in the logfiles for that?
What about adding just some lines that tell me where actions end up.
Or *ghasp* what about giving me a warning if I declare an invalid path?
So right now I have to come to a decision:
Keep CommonNavigator and all the nice goodies OR
cut it out and do it in a clean RCP-App.
And my frustration will probably lead to the latter one.
I am sitting here, after weeks of coding with the CommonNavigator framework in eclipse, just to realize that I might have to completely remove it or lose the last tiny shard of sanity left in my head.
Yes, CommonNavigator is awesome, somewhat.
The absolute absence of debugging help in it is just frustrating.
Not knowing what is wrong with your XMl and not getting any help from eclipse is rather frustrating.
By googling a little you will discover pretty soon that I am not the only person who is unable to get actions to show in the places you actually want em to show up.
By now I think I got a pretty good grasp on eclipse and the dreaded toolBar/menuBar-paths.
I even understand how the objectContributions work.
But the vieweContribution stuff is a complete mystery to me.
Seems like as if I will have to read some source code to figure out what I am doing wrong.
Would it really be that hard to provide some help in the logfiles for that?
What about adding just some lines that tell me where actions end up.
Or *ghasp* what about giving me a warning if I declare an invalid path?
So right now I have to come to a decision:
Keep CommonNavigator and all the nice goodies OR
cut it out and do it in a clean RCP-App.
And my frustration will probably lead to the latter one.
Saturday, July 28, 2007
How to get a navigator view in RCP
I am struggling with the Common Navigator Framework right now.
After finding a good tutorial on CNF I started hacking away.
The problem was that I needed a navigator view to actually do something with my fancy new CNF.
Creating the view is only half the deal and after some google research I finally found the part that was missing:
In your perspective add the Navigator View
In your WorkbenchAdvisor (normally called ApplicationWorkbenchAdvisor if you used the PlugIn wizard) overwrite the preStartup method and add the following line:
org.eclipse.ui.navigator
org.eclipse.ui.navigator.resources
org.eclipse.ui.ide
org.eclipse.ui.navigator
After finding a good tutorial on CNF I started hacking away.
The problem was that I needed a navigator view to actually do something with my fancy new CNF.
Creating the view is only half the deal and after some google research I finally found the part that was missing:
In your perspective add the Navigator View
And now for the part that I was missing.
IFolderLayout topLeft= layout.createFolder("topLeft",IPageLayout.LEFT,
0.25f,layout.getEditorArea());
topLeft.addView(IPageLayout.ID_RES_NAV);
In your WorkbenchAdvisor (normally called ApplicationWorkbenchAdvisor if you used the PlugIn wizard) overwrite the preStartup method and add the following line:
Uh, I almost forgot about the dependencies:
WorkbenchAdapterBuilder.registerAdapters();
org.eclipse.ui.navigator
org.eclipse.ui.navigator.resources
org.eclipse.ui.ide
org.eclipse.ui.navigator
Subscribe to:
Posts (Atom)