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


Java AbstractTextSearchResult.getMatches方法代码示例

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


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

import org.eclipse.search.ui.text.AbstractTextSearchResult; //导入方法依赖的package包/类
public TypeScriptMatch[] getMatches(AbstractTextSearchResult result) {
	ArrayList res= new ArrayList();
	Match[] matches= result.getMatches(fParent);
	for (int i= 0; i < matches.length; i++) {
		TypeScriptMatch curr= (TypeScriptMatch) matches[i];
		if (curr.getLineElement() == this) {
			res.add(curr);
		}
	}
	return (TypeScriptMatch[]) res.toArray(new TypeScriptMatch[res.size()]);
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:12,代码来源:LineElement.java

示例4: getNumberOfMatches

import org.eclipse.search.ui.text.AbstractTextSearchResult; //导入方法依赖的package包/类
public int getNumberOfMatches(AbstractTextSearchResult result) {
	int count= 0;
	Match[] matches= result.getMatches(fParent);
	for (int i= 0; i < matches.length; i++) {
		TypeScriptMatch curr= (TypeScriptMatch) matches[i];
		if (curr.getLineElement() == this) {
			count++;
		}
	}
	return count;
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:12,代码来源:LineElement.java

示例5: getNumberOfPotentialMatches

import org.eclipse.search.ui.text.AbstractTextSearchResult; //导入方法依赖的package包/类
protected final int getNumberOfPotentialMatches(Object element) {
	int res= 0;
	AbstractTextSearchResult result= fPage.getInput();
	if (result != null) {
		Match[] matches= result.getMatches(element);
		for (int i = 0; i < matches.length; i++) {
			if ((matches[i]) instanceof JavaElementMatch) {
				if (((JavaElementMatch)matches[i]).getAccuracy() == SearchMatch.A_INACCURATE)
					res++;
			}
		}
	}
	return res;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:15,代码来源:SearchLabelProvider.java

示例6: getMatches

import org.eclipse.search.ui.text.AbstractTextSearchResult; //导入方法依赖的package包/类
@Override
public PyModuleMatch[] getMatches(AbstractTextSearchResult result) {
    ArrayList<PyModuleMatch> res = new ArrayList<PyModuleMatch>();
    Match[] matches = result.getMatches(fParent);
    for (int i = 0; i < matches.length; i++) {
        PyModuleMatch curr = (PyModuleMatch) matches[i];
        if (curr.getLineElement() == this) {
            res.add(curr);
        }
    }
    return res.toArray(new PyModuleMatch[res.size()]);
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:13,代码来源:PyModuleLineElement.java

示例7: getNumberOfMatches

import org.eclipse.search.ui.text.AbstractTextSearchResult; //导入方法依赖的package包/类
@Override
public int getNumberOfMatches(AbstractTextSearchResult result) {
    int count = 0;
    Match[] matches = result.getMatches(fParent);
    for (int i = 0; i < matches.length; i++) {
        PyModuleMatch curr = (PyModuleMatch) matches[i];
        if (curr.getLineElement() == this) {
            count++;
        }
    }
    return count;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:13,代码来源:PyModuleLineElement.java

示例8: 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

示例9: getMatches

import org.eclipse.search.ui.text.AbstractTextSearchResult; //导入方法依赖的package包/类
@Override
public FileMatch[] getMatches(AbstractTextSearchResult result) {
    ArrayList<FileMatch> res = new ArrayList<FileMatch>();
    Match[] matches = result.getMatches(fParent);
    for (int i = 0; i < matches.length; i++) {
        FileMatch curr = (FileMatch) matches[i];
        if (curr.getLineElement() == this) {
            res.add(curr);
        }
    }
    return res.toArray(new FileMatch[res.size()]);
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:13,代码来源:LineElement.java

示例10: getNumberOfMatches

import org.eclipse.search.ui.text.AbstractTextSearchResult; //导入方法依赖的package包/类
@Override
public int getNumberOfMatches(AbstractTextSearchResult result) {
    int count = 0;
    Match[] matches = result.getMatches(fParent);
    for (int i = 0; i < matches.length; i++) {
        FileMatch curr = (FileMatch) matches[i];
        if (curr.getLineElement() == this) {
            count++;
        }
    }
    return count;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:13,代码来源:LineElement.java

示例11: 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.getMatches方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。