2011-07-24 71 views

回答

2

您可以使用IWorkbenchPage.getActiveEditor或getEditors(),那麼你可以 問他們IEditorInput編輯。如果編輯器在 上運行一個IFile(並且無法保證),則可以將 IEditorInput轉換爲IFileEditorInput,以通過 IFileEditorInput.getFile()訪問該文件。

一旦你得到的IFile你可以得到路徑eaisly

參考 http://www.eclipse.org/forums/index.php/mv/tree/12808/

相關問題