creating input part via part descriptor [message #1007776] |
Thu, 07 February 2013 08:32  |
Eclipse User |
|
|
|
Hi there!
In my RCP-Application I have defined a PartDescriptor within a
Perspective and want to place an InputPart there.
Because in PartService there is no method createInputPart(String
descriptorID) I created a utility method using the code from
PartService.createPart(MPartDescriptor descriptor).
public static MInputPart createInputPart(String id, String inputURI,
EPartService partService) {
MPart part = partService.createPart(id);
MInputPart inputPart = MBasicFactory.INSTANCE.createInputPart();
inputPart.setInputURI(inputURI);
inputPart.setElementId(part.getElementId());
inputPart.getMenus().addAll(EcoreUtil.copyAll(part.getMenus()));
if (part.getToolbar() != null) {
inputPart.setToolbar((MToolBar)EcoreUtil.copy((EObject)part.getToolbar()));
}
inputPart.setContributorURI(part.getContributorURI());
inputPart.setCloseable(part.isCloseable());
inputPart.setContributionURI(part.getContributionURI());
inputPart.setLabel(part.getLabel());
inputPart.setIconURI(part.getIconURI());
inputPart.setTooltip(part.getTooltip());
inputPart.getHandlers().addAll(EcoreUtil.copyAll(part.getHandlers()));
inputPart.getTags().addAll(part.getTags());
inputPart.getBindingContexts().addAll(part.getBindingContexts());
return inputPart;
}
Using the returned InputPart I get an InjectionException because there
is no MDirtyable found to inject into my PartContribution class.
Using the part via partService.createPart(id) all works well.
partService.showPart(inputPart, PartState.ACTIVATE); -> Exception
partService.showPart(part, PartState.ACTIVATE); -> everything is fine
I debugged the code and can't find a difference. What am I doing wrong?
Regards,
Jan
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: creating input part via part descriptor [message #1008431 is a reply to message #1008318] |
Tue, 12 February 2013 07:53  |
Eclipse User |
|
|
|
Am 11.02.2013 16:54, schrieb Tom Schindl:> Hi,
....
>
> Then would provide a ResourceFactoryService which looks something like
this:
....
>
> which can be registered for a protocol e.g. "my-protocol"
....
Would you mind giving me a hint how to register a service for a
protocol, please?
Jan
|
|
|
Powered by
FUDForum. Page generated in 0.08107 seconds