Search code examples
eclipsercpe4

How to open a Part without duplicate?


I am developing 'Pure' Eclipse 4 RCP application. I want to open a 'part' using method like page.openEditor(IEditorInput input, String editorId, boolean activate); in e3.x

How can i do this?


Solution

  • You use EPartService to manage parts:

    @Inject
    private EPartService partService;
    
    
    MPart mpart = partService.showPart("part id", PartState.ACTIVATE);
    

    if necessary you can then access your part class:

    MyPart myPart = (MyPart)mpart.getObject();