将java方法存储在java元素变量compilationunit eclipse中

时间:2016-11-16 18:47:12

标签: java eclipse eclipse-plugin eclipse-pde

我需要在IJavaElement变量中存储一个方法。我有实现方法的文件路径和方法的标题。

这就是我所拥有的:

IFileStore fileStore = EFS.getLocalFileSystem().getStore(fileToOpen.toURI());
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorPart editor =IDE.openEditorOnFileStore(page, fileStore);
ICompilationUnit root = (ICompilationUnit) EditorUtility.getEditorInputJavaElement(editor, false);

问候。

0 个答案:

没有答案