Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

How do I retrieve editors registered for a certain file extension in Eclipse?

IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
IEditorDescriptor [] desc = registry.getEditors("file name");
//The IEditorDescriptor contains the editor id which you can pass to 
//open of the openEditor methods of IWorkbenchPage

//If you want to open the same file in two editors at the same time 
public IEditorPart openEditor(final IEditorInput input,
         final String editorId, final boolean activate, final int matchFlags)
//Specify IWorkbenchPage.MATCH_NONE as the matchFlags to stop the search for an existing open editor.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #I #retrieve #editors #registered #file #extension
ADD COMMENT
Topic
Name
1+1 =