/**
* 得到当前编辑器所属工程的绝对路径
*/
public static String getCurrentProjectFileAbsolutePath(){
String fullPath = "";
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
if (getActiveEditorInput() instanceof WorkflowEditorInput) {
IPath location = Path.fromOSString(((WorkflowEditorInput)getActiveEditorInput()).getRelateFilename());
IFile file = workspaceRoot.getFileForLocation(location);
fullPath = file.getProject().getLocation().toOSString();
}
return fullPath;
}
通过系统文件路径取得插件工程路径的方法
最新推荐文章于 2021-08-09 15:44:31 发布