当前位置: 首页>>代码示例>>Java>>正文


Java AbstractTextSearchResult.getElements方法代码示例

本文整理汇总了Java中org.eclipse.search.ui.text.AbstractTextSearchResult.getElements方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractTextSearchResult.getElements方法的具体用法?Java AbstractTextSearchResult.getElements怎么用?Java AbstractTextSearchResult.getElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.search.ui.text.AbstractTextSearchResult的用法示例。


在下文中一共展示了AbstractTextSearchResult.getElements方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import org.eclipse.search.ui.text.AbstractTextSearchResult; //导入方法依赖的package包/类
private synchronized void initialize(AbstractTextSearchResult result) {
	fResult= result;
	fChildrenMap= new HashMap();
	boolean showLineMatches= true; //!((TypeScriptSearchQuery) fResult.getQuery()).isFileNameSearch();
	
	if (result != null) {
		Object[] elements= result.getElements();
		for (int i= 0; i < elements.length; i++) {
			if (showLineMatches) {
				Match[] matches= result.getMatches(elements[i]);
				for (int j= 0; j < matches.length; j++) {
					insert(((TypeScriptMatch) matches[j]).getLineElement(), false);
				}
			} else {
				insert(elements[i], false);
			}
		}
	}
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:20,代码来源:TypeScriptSearchTreeContentProvider.java

示例2: initialize

import org.eclipse.search.ui.text.AbstractTextSearchResult; //导入方法依赖的package包/类
private synchronized void initialize(AbstractTextSearchResult result) {
    fResult = result;
    fChildrenMap = new HashMap<Object, Set>();
    boolean showLineMatches = !((AbstractPythonSearchQuery) fResult.getQuery()).isFileNameSearch();

    if (result != null) {
        Object[] elements = result.getElements();
        for (int i = 0; i < elements.length; i++) {
            if (showLineMatches) {
                Match[] matches = result.getMatches(elements[i]);
                for (int j = 0; j < matches.length; j++) {
                    insert(((FileMatch) matches[j]).getLineElement(), false);
                }
            } else {
                insert(elements[i], false);
            }
        }
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:20,代码来源:FileTreeContentProvider.java

示例3: initialize

import org.eclipse.search.ui.text.AbstractTextSearchResult; //导入方法依赖的package包/类
@Override
protected synchronized void initialize(AbstractTextSearchResult result) {
	super.initialize(result);
	fChildrenMap= new HashMap<Object, Set<Object>>();
	if (result != null) {
		Object[] elements= result.getElements();
		for (int i= 0; i < elements.length; i++) {
			if (getPage().getDisplayedMatchCount(elements[i]) > 0) {
				insert(null, null, elements[i]);
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:14,代码来源:LevelTreeContentProvider.java

示例4: inputChanged

import org.eclipse.search.ui.text.AbstractTextSearchResult; //导入方法依赖的package包/类
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
    elementToTreeNode.clear();
    if (newInput instanceof AbstractTextSearchResult) {
        AbstractTextSearchResult abstractTextSearchResult = (AbstractTextSearchResult) newInput;
        this.fResult = abstractTextSearchResult;
        root = new TreeNode<>(null, newInput);
        Object[] elements = abstractTextSearchResult.getElements();
        int elementsLen = elements.length;
        for (int i = 0; i < elementsLen; i++) {
            Object object = elements[i];
            Match[] matches = abstractTextSearchResult.getMatches(object);
            int matchesLen = matches.length;
            for (int j = 0; j < matchesLen; j++) {
                Match match = matches[j];
                if (match instanceof ICustomMatch) {
                    ICustomMatch moduleMatch = (ICustomMatch) match;
                    obtainTeeNodeElement(moduleMatch.getLineElement());
                } else {
                    Log.log("Expecting ICustomMatch. Found:" + match.getClass() + " - " + match);
                }
            }
        }
    } else {
        this.clear();
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:28,代码来源:AbstractSearchIndexTreeContentProvider.java

示例5: initialize

import org.eclipse.search.ui.text.AbstractTextSearchResult; //导入方法依赖的package包/类
private synchronized void initialize(AbstractTextSearchResult result) {
    fResult = result;
    fChildrenMap = new HashMap();
    if (result != null) {
        Object[] elements = result.getElements();
        for (int i = 0; i < elements.length; i++) {
            insert(elements[i], false);
        }
    }
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:11,代码来源:UrnTreeContentProvider.java

示例6: getLabel

import org.eclipse.search.ui.text.AbstractTextSearchResult; //导入方法依赖的package包/类
@Override
public String getLabel() {
    StructuredViewer viewer = getViewer();
    if (viewer instanceof TreeViewer) {
        int count = 0;
        TreeViewer tv = (TreeViewer) viewer;

        final AbstractTextSearchResult input = getInput();
        if (input != null) {
            ViewerFilter[] filters = tv.getFilters();
            if (filters != null && filters.length > 0) {
                Object[] elements = input.getElements();
                for (int j = 0; j < elements.length; j++) {
                    Object element = elements[j];
                    Match[] matches = input.getMatches(element);
                    for (Match match : matches) {
                        for (int i = 0; i < filters.length; i++) {
                            ViewerFilter vf = filters[i];
                            if (vf instanceof AbstractSearchResultsViewerFilter) {
                                AbstractSearchResultsViewerFilter searchResultsViewerFilter = (AbstractSearchResultsViewerFilter) vf;
                                if (searchResultsViewerFilter.isLeafMatch(viewer, match)) {
                                    count += 1;
                                }
                            }
                        }
                    }
                }
            } else {
                // No active filters
                count = input.getMatchCount();
            }
        }
        AbstractTextSearchResult result = getInput();
        if (result == null) {
            return "";
        }
        ISearchQuery query = result.getQuery();
        if (query instanceof AbstractSearchIndexQuery) {
            AbstractSearchIndexQuery searchIndexQuery = (AbstractSearchIndexQuery) query;
            return searchIndexQuery.getResultLabel(count);
        }
    }
    return super.getLabel();
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:45,代码来源:AbstractSearchIndexResultPage.java


注:本文中的org.eclipse.search.ui.text.AbstractTextSearchResult.getElements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。