use of org.eclipse.ui.part.IShowInTarget in project KaiZen-OpenAPI-Editor by RepreZen.
the class DocumentUtils method openAndReveal.
/**
* Opens the editor for the file located at the given path and reveal the selection.
*
* @param path
* @param selection
*/
public static void openAndReveal(IPath path, ISelection selection) {
final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
final IFile file = root.getFile(path);
final IEditorPart editor = openEditor(file);
if (editor instanceof IShowInTarget) {
IShowInTarget showIn = (IShowInTarget) editor;
showIn.show(new ShowInContext(null, selection));
}
}
Aggregations