use of org.eclipse.ui.part.FileEditorInput in project yamcs-studio by yamcs.
the class ResourceUtil method editorInputFromPath.
public static IEditorInput editorInputFromPath(IPath path) {
IEditorInput editorInput = null;
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
// by Eclipse.
if (!ResourceUtil.isExistingWorkspaceFile(path) && ResourceUtil.isExistingLocalFile(path)) {
IFileStore fileStore = EFS.getLocalFileSystem().getStore(file.getFullPath());
editorInput = new FileStoreEditorInput(fileStore);
} else {
editorInput = new FileEditorInput(file);
}
return editorInput;
}
use of org.eclipse.ui.part.FileEditorInput in project yamcs-studio by yamcs.
the class OpenFileAction method openFileInBuilderMode.
private void openFileInBuilderMode(IFile file) {
if (file.getFileExtension().equalsIgnoreCase("opi")) {
try {
boolean activate = OpenStrategy.activateOnOpen();
page.openEditor(new FileEditorInput(file), "org.csstudio.opibuilder.OPIEditor", activate, IWorkbenchPage.MATCH_INPUT | IWorkbenchPage.MATCH_ID);
} catch (PartInitException e) {
DialogUtil.openError(page.getWorkbenchWindow().getShell(), "Problems Opening Editor", e.getMessage(), e);
}
} else {
openFile(file);
}
}
Aggregations