📜  如何在 Eclipse 中检索为某个文件扩展名注册的编辑器? - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:12.892000             🧑  作者: Mango

代码示例1
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.