|
|
Re: get IFile from IDocument [message #1769217 is a reply to message #333610] |
Thu, 27 July 2017 18:08  |
Eclipse User |
|
|
|
I want to do the same with eclipse neon, but i don't find FileEditorInput.
My code here
public static File getFileFromEditor() {
IWorkbench iworkbench = PlatformUI.getWorkbench();
IWorkbenchWindow activeWorkbenchWindow = null;
if(iworkbench != null) {
activeWorkbenchWindow = iworkbench.getActiveWorkbenchWindow();
}
IWorkbenchPage activePage = null;
if(activeWorkbenchWindow != null) {
activePage = activeWorkbenchWindow.getActivePage();
}
IEditorPart activeEditor = null;
if(activePage != null ) {
activeEditor = activePage.getActiveEditor();
}
if(activeEditor != null) {
return findFileFromWorkspace(activeEditor.getTitle());
[code][/code]}
return null;
}
|
|
|
Powered by
FUDForum. Page generated in 0.05066 seconds