本文整理汇总了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);
}
}
}
}
示例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);
}
}
}
}
示例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()]);
}
示例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;
}
示例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;
}
示例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()]);
}
示例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;
}
示例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();
}
}
示例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()]);
}
示例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;
}
示例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();
}