IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); IPath path = new Path("somefile.txt"); IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(file.getName()); page.openEditor(new FileEditorInput(file), desc.getId());
Posts