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.