本文整理汇总了Java中org.eclipse.search.ui.ISearchResult类的典型用法代码示例。如果您正苦于以下问题:Java ISearchResult类的具体用法?Java ISearchResult怎么用?Java ISearchResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ISearchResult类属于org.eclipse.search.ui包,在下文中一共展示了ISearchResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setInput
import org.eclipse.search.ui.ISearchResult; //导入依赖的package包/类
@Override
public void setInput(final ISearchResult newSearch, final Object viewState)
{
super.setInput(newSearch, viewState);
if (newSearch != null)
{
if (getLayout() == AbstractTextSearchViewPage.FLAG_LAYOUT_FLAT)
{
final IJiveSearchResult result = (IJiveSearchResult) newSearch;
final IJiveSearchQuery query = result.getQuery();
resultType = query.getResultType();
setLayout(AbstractTextSearchViewPage.FLAG_LAYOUT_TREE);
setLayout(AbstractTextSearchViewPage.FLAG_LAYOUT_FLAT);
}
// Display the sequence diagram and notify it of changing results
final IJiveGraphicalView diagram = (IJiveGraphicalView) showView(JiveUIPlugin.ID_SEQUENCE_DIAGRAM_VIEW);
final IJiveDebugTarget activeTarget = JiveSearchResultPage.activeTarget();
if (activeTarget != null)
{
final GraphicalViewer viewer = diagram.getViewer();
final IQueryListener contents = (IQueryListener) viewer.getContents();
contents.queryFinished(newSearch.getQuery());
}
}
}
示例2: setInput
import org.eclipse.search.ui.ISearchResult; //导入依赖的package包/类
@Override
public void setInput(ISearchResult search, Object uiState) {
if (search != null) {
search.addListener(this);
}
files = new ArrayList<IFile>();
}
示例3: getSearchResult
import org.eclipse.search.ui.ISearchResult; //导入依赖的package包/类
@Override
public ISearchResult getSearchResult() {
if (result == null) {
result = new EditorConfigSearchResult(this);
}
return result;
}
示例4: getSearchResult
import org.eclipse.search.ui.ISearchResult; //导入依赖的package包/类
@Override
public ISearchResult getSearchResult() {
if (searchResult == null) {
TypeScriptSearchResult result = new TypeScriptSearchResult(this);
// new SearchResultUpdater(result);
searchResult = result;
}
return searchResult;
}
示例5: getSearchResult
import org.eclipse.search.ui.ISearchResult; //导入依赖的package包/类
/**
* @see org.eclipse.search.ui.ISearchQuery#getSearchResult()
*/
public ISearchResult getSearchResult() {
if (result == null) {
result = new UMLInverseReferenceModelSearchResult(this);
return result;
}
return result;
}
示例6: getSearchResult
import org.eclipse.search.ui.ISearchResult; //导入依赖的package包/类
/**
* @see org.eclipse.search.ui.ISearchQuery#getSearchResult()
*/
public ISearchResult getSearchResult() {
if (result == null) {
result = new UMLModelSearchResult(this);
return result;
}
return result;
}
示例7: setInput
import org.eclipse.search.ui.ISearchResult; //导入依赖的package包/类
public void setInput(ISearchResult newSearchResult, Object uiState) {
synchronized (viewer) {
this.searchResult = newSearchResult;
if (searchResult != null) {
viewer.setInput(newSearchResult);
if (uiState instanceof ISelection) {
viewer.setSelection((ISelection) uiState);
}
}
part.updateLabel();
}
}
示例8: getLabel
import org.eclipse.search.ui.ISearchResult; //导入依赖的package包/类
@Override
public String getLabel() {
final ISearchResult result = getInput();
if(result != null) {
return result.getLabel();
}
return "";
}
示例9: getSearchResult
import org.eclipse.search.ui.ISearchResult; //导入依赖的package包/类
@Override
public ISearchResult getSearchResult() {
if(result == null) {
return getEmptyResult();
}
return result;
}
示例10: testFind
import org.eclipse.search.ui.ISearchResult; //导入依赖的package包/类
@Test
public void testFind() throws Exception {
JavaSearchQuery query =
SearchTestHelper.runMethodRefQuery("junit.framework.Test", "countTestCases", new String[0]);
ISearchResult result = query.getSearchResult();
JavaSearchResult javaResult = ((JavaSearchResult) result);
Assertions.assertThat(javaResult.getElements()).hasSize(9);
}
示例11: testFind2
import org.eclipse.search.ui.ISearchResult; //导入依赖的package包/类
@Test
public void testFind2() throws Exception {
IPackageFragmentRoot root =
((JavaProject) JUnitSourceSetup.getProject())
.getPackageFragmentRoot(new Path(JUnitSourceSetup.SRC_CONTAINER));
IPackageFragment packageFragment = root.createPackageFragment("che", true, null);
StringBuilder a = new StringBuilder();
a.append("package che;\n");
a.append("public class A{}\n");
packageFragment.createCompilationUnit("A.java", a.toString(), true, null);
StringBuilder b = new StringBuilder();
b.append("package che;\n");
b.append("import java.util.Comparator;\n");
b.append("public class B extends A implements Comparator<A>{\n");
b.append(" @Override\n");
b.append(" public int compare(A o1, A o2) {\n");
b.append(" A bb = null;\n");
b.append(" return 0;\n");
b.append(" }\n");
b.append("}\n");
packageFragment.createCompilationUnit("B.java", b.toString(), true, null);
JavaSearchQuery query = SearchTestHelper.runTypeRefQuery("che.A");
ISearchResult result = query.getSearchResult();
JavaSearchResult javaResult = ((JavaSearchResult) result);
Assertions.assertThat(javaResult.getElements()).hasSize(2);
}
示例12: getSearchResult
import org.eclipse.search.ui.ISearchResult; //导入依赖的package包/类
public ISearchResult getSearchResult() {
if (fResult == null) {
JavaSearchResult result = new JavaSearchResult(this);
new SearchResultUpdater(result);
fResult = result;
}
return fResult;
}
示例13: getSearchResult
import org.eclipse.search.ui.ISearchResult; //导入依赖的package包/类
public ISearchResult getSearchResult() {
if (fResult == null) {
JavaSearchResult result= new JavaSearchResult(this);
new SearchResultUpdater(result);
fResult= result;
}
return fResult;
}
示例14: setInput
import org.eclipse.search.ui.ISearchResult; //导入依赖的package包/类
@Override
public void setInput(final ISearchResult newSearch, final Object state) {
super.setInput(newSearch, state);
clear();
if (newSearch != null) {
elementsChanged(((AbstractTextSearchResult) newSearch).getElements());
}
}
示例15: searchResultChanged
import org.eclipse.search.ui.ISearchResult; //导入依赖的package包/类
@Override
public void searchResultChanged(final SearchResultEvent e)
{
final ISearchResult result = e.getSearchResult();
if (result instanceof IJiveSearchResult)
{
if (e instanceof MatchEvent)
{
final MatchEvent matchEvent = (MatchEvent) e;
switch (matchEvent.getKind())
{
case MatchEvent.ADDED:
addSearchResults(matchEvent.getMatches());
break;
case MatchEvent.REMOVED:
if (searchResultMap.size() > 1)
{
removeSearchResults(matchEvent.getMatches());
focusResults();
}
else
{
unfocusResults();
}
break;
}
}
else if (e instanceof RemoveAllEvent)
{
unfocusResults();
}
forceUpdate();
}
}