}
}
@Override
protected void internalExecute(final Command cmd) throws Exception {
final OpenFileCommand c = (OpenFileCommand) cmd;
final IFile file = javaFileToPluginFile(c.getFileName());
if (file != null){
// it seems that file is in the workspace
final IWorkbench workbench = PlatformUI.getWorkbench();
workbench.getDisplay().syncExec(new Runnable() {
@Override
public void run() {
final IWorkbenchWindow activeWorkbenchWindow =
workbench.getActiveWorkbenchWindow();
final IWorkbenchPage page =
activeWorkbenchWindow.getActivePage();
openInEditor(page, file, c.getLineNumber());
}
});
return;
}
// here comes the alternative approach: open file through EFS local fs
final File f = new File(c.getFileName());
final IFileStore fileStore =
EFS.getLocalFileSystem().getStore(f.toURI());
final IWorkbench workbench = PlatformUI.getWorkbench();
workbench.getDisplay().syncExec(new Runnable() {
@Override