您的位置:首页 > 编程语言 > PHP开发

根据给定的IEditPar或IEditorInput获取IFile实例。

2012-09-03 14:53 281 查看
根据IEditorInput获取IFile实例
 public static IFile getFile(IEditorInput editorInput) {
if (editorInput == null) {
return null;
}
Object o = editorInput.getAdapter(IFile.class);
if (o instanceof IFile) {
return (IFile) o;
}
return null;
}

根据IEditorPart获取IFile实例

The code below will demonstrate how to do this.

IFile file = (IFile) editorPart.getEditorInput().getAdapter(IFile.class);
if (file != null) {
// do stuff
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: