Open edit part (like editor in previous versions of eclipse) in Eclipse RCP 4
I was wondering how I can open the e4 editor with input (or an alternative to passing data from a view) in a pure RCP 4 application.
If that helps, here is an app with all the things you need (except the actual editor) https://www.dropbox.com/s/zamn1t2kqr0525c/com.test.pureE4.zip?dl=0
Thank you in advance!
+3
source to share
1 answer
You can set the data for a part in the transient data for a part.
Something like:
@Inject
EPartService partService;
// Create the part
MPart part = partService.createPart("editor id");
// Set the input
part.getTransientData().put("input key", inputData);
// Add to editor part stack
MPartStack editorStack = ... find your part stack for the editor
editorStack.getChildren().add(part);
// Show
partService.showPart(part, PartState.ACTIVATE);
In the editor code:
@Inject
MPart part;
inputData = part.getTransientData().get("input key");
+3
source to share