Hallo!
ich würde gerne eine Datei(vom Typ File, liegt nicht im Workspace) in einem Editor öffnen. Eclipse bietet dafür im Wiki auch folgendes Tutorial an, das ich allerdings nicht ganz verstehe..
FAQ How do I open an editor on a file outside the workspace? - Eclipsepedia
die zweite variante funtioniert bei mir ohne Probleme. Die erste allerdings nicht, weil ich nicht weiss was und von welchem Typ names ist oder etwa filterPath.
Kann mir da villeicht jemand helfen?
Wo ich schon einmal dabei bin würde ich auch gerne fragen ob es zu der ResourceSet eigentlich ein Gegenstück in der Workspace gibt, also so etwas wie IResourceSet? Bei Resource gibt es ja IResource usw..
ich würde gerne eine Datei(vom Typ File, liegt nicht im Workspace) in einem Editor öffnen. Eclipse bietet dafür im Wiki auch folgendes Tutorial an, das ich allerdings nicht ganz verstehe..
FAQ How do I open an editor on a file outside the workspace? - Eclipsepedia
die zweite variante funtioniert bei mir ohne Probleme. Die erste allerdings nicht, weil ich nicht weiss was und von welchem Typ names ist oder etwa filterPath.
Kann mir da villeicht jemand helfen?
Java:
String name= new FileDialog(aShell, SWT.OPEN).open();
if (name == null)
return;
IFileStore fileStore = EFS.getLocalFileSystem().getStore(new Path(filterPath));
fileStore = fileStore.getChild(names[i]);
if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists()) {
IWorkbenchPage page= window.getActivePage();
try {
IDE.openEditorOnFileStore(page, fileStore);
} catch (PartInitException e) {
/* some code */
}
}
Wo ich schon einmal dabei bin würde ich auch gerne fragen ob es zu der ResourceSet eigentlich ein Gegenstück in der Workspace gibt, also so etwas wie IResourceSet? Bei Resource gibt es ja IResource usw..
Zuletzt bearbeitet: