在rcp中獲取文件:
得到Appliaction workspace, Platform.asLocalURL(PRODUCT_BUNDLE.getEntry("")).getPath()).getAbsolutePath();
得到runtimeworkspace, Platform.getInstanceLocation().getURL().getPath();
通過EditorInput來得到工程的絕對路徑:
((IFileEditorInput)input).getFile().getLocation().makeAbsolute().toFile().getAbsoluteFile().getParentFile();
通過父EditPart得到編輯器的方法(GEF):
IEditorPart editor = ((DefaultEditDomain)(parent.getViewer().getEditDomain())).getEditorPart();