UIHelper.java 文件源码

java
阅读 32 收藏 0 点赞 0 评论 0

项目:tlaplus 作者:
/**
 * 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");
        }

    };
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号