/**
* Retrieves the selection provider for files in the active editor
*
* @return
*/
public static ISelectionProvider getActiveEditorFileSelectionProvider() {
return new GenericSelectionProvider() {
public ISelection getSelection() {
IEditorInput input = getActiveEditor().getEditorInput();
if (input instanceof FileEditorInput) {
IFile resource = ((FileEditorInput) input).getFile();
return new StructuredSelection(resource);
}
return null;
}
public void setSelection(ISelection selection) {
throw new UnsupportedOperationException("This selection provider is read-only");
}
};
}
UIHelper.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:tlaplus
作者:
评论列表
文章目录