Force to access contributor immediately, after setting the ContributorURI? [message #985933] |
Fri, 16 November 2012 12:56  |
Eclipse User |
|
|
|
I have a main-application and a plugin.
Main-application sets the ContributorURI for a Part at some point.
Here is the class, which the ContributorURI points to:
public class TestPart {
@Inject
private MApplication application;
@PostConstruct
public void createControls(Composite parent) {
application.getContext().set(Composite.class, parent);
}
}
After setting the ContributorURI I trigger the plugin, which should do something with Composite.class in context.
This is the only way I found to switch from E4 MPart.. to the SWT Composite API and to pass it to the plugin.
Problem:
The problem is, that after setting the ContributorURI the above class is not immediately triggered, so that the plugin wont find the Composite it depends on.
Question:
How can I force the Platform to trigger createControls immediately, after setting ContributorURI?
|
|
|
|
|
Re: Force to access contributor immediately, after setting the ContributorURI? [message #986150 is a reply to message #986006] |
Mon, 19 November 2012 03:31   |
Eclipse User |
|
|
|
My Problem is, that I need the Part-implementation, which should be linked to it's Part.
The only way I know to link a partimplemntation with its Part - is by doing Part.setContributionURI().
Offcourse the part implementation should be allready initialized, when I am using it,
but if I initialize it manually (by creating an instance by ContextInjectionFactory.make(TestPart.class, context)) - I can not connect the implementation with its Part, because it only works with the URI.
If I just set the URI to connect the part with the implementation - then the part is connected with it's implementation, but it is not immediately initialized.
Question:
So, how can I connect a part with it's implementation, if I instantiated the implementation by ContextInjectionFactory.make(TestPart.class, context))
OR
how can I retrieve the instance of part-implementation, if the Part implementation was set by URI (Part.setContributionURI())
[Updated on: Mon, 19 November 2012 06:49] by Moderator
|
|
|
Re: Force to access contributor immediately, after setting the ContributorURI? [message #986201 is a reply to message #986150] |
Mon, 19 November 2012 07:36   |
Eclipse User |
|
|
|
Ahm I'm just reading that your call setContributorURI which is wrong and
should be *setContributionURI*!!
Tom
Am 19.11.12 09:31, schrieb Alex Kipling:
> My Problem is, that I need the Part-implementation, which should be
> linked to it's Part.
> The only way I know to link a partimplemntation with its Part - is by
> doing Part.setContributorURI().
>
> Offcourse the Partimplementation should be allready initialized, when I
> am using it,
> but if I initialize it manually (by craeating an instance by
> ContextInjectionFactory.make(TestPart.class, context)) - I can not
> connect the implementation with its Part, because it only works with the
> URI.
> If I just set the URI to connect the Part with the implementation - then
> the Part is connected with it's implementation, but it is not
> immediately initialized.
>
> How can I connect the Part with it's implementation AND initialize it
> immediately?
>
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08186 seconds