Parameterized view or editor [message #459730] |
Wed, 06 December 2006 22:07 |
Eclipse User |
|
|
|
Is it possible to create a parameterized view or editor? I want to define a view that extends ViewPart that has a setter method on it that takes in a factory like so:
public class MyView extends ViewPart
{
public void setPartFactory(PartFactory factory)
{
this.factory = factory;
}
private void doSomething()
{
Parts parts = factory.createParts();
...
}
The idea is that I want to use the default version of the PartFactory internally (if not provided by the extension), but if the extension wants, it can provide an alternate PartFactory.
I have been using spring, and in spring it is really very simple to define multiple beans (in our case that implement PartFactory) and plug them into generic parameterized classes to get different behavior.
Whats the easiest way the same "pluggable bean mechanism" that Spring uses going in the Eclipse platform?
Thanks,
Nik
|
|
|
Powered by
FUDForum. Page generated in 0.03659 seconds