Reputation: 3558
I would like to programmatically (from a context menu) open a certain view How can I do so?
I can show a view using e3 compatibility layer like this:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("viewId");
What is the e4 way to do so?
Upvotes: 0
Views: 1121
Reputation: 111142
In e4 you open any part using EPartService
:
@Inject
EPartService partService;
partService.showPart("part id", PartState.ACTIVATE);
The part should be in the Application.e4xmi in the place you want it to show but should have 'To Be Rendered' turned off (leave 'Visible' on).
Upvotes: 1