本文整理汇总了Java中org.eclipse.search.ui.NewSearchUI.runQueryInBackground方法的典型用法代码示例。如果您正苦于以下问题:Java NewSearchUI.runQueryInBackground方法的具体用法?Java NewSearchUI.runQueryInBackground怎么用?Java NewSearchUI.runQueryInBackground使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.search.ui.NewSearchUI
的用法示例。
在下文中一共展示了NewSearchUI.runQueryInBackground方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: open
import org.eclipse.search.ui.NewSearchUI; //导入方法依赖的package包/类
@Override
public void open() {
// Execute Search
try {
int offset = tsFile.getPosition(getRange().startLineNumber, getRange().startColumn);
TypeScriptSearchQuery query = new TypeScriptSearchQuery(tsFile.getResource(), offset);
NewSearchUI.runQueryInBackground(query);
} catch (TypeScriptException e) {
e.printStackTrace();
}
}
示例2: performAction
import org.eclipse.search.ui.NewSearchUI; //导入方法依赖的package包/类
/**
* search버튼을 눌렀을때 수행되는 액션
*
* @see org.eclipse.search.ui.ISearchPage#performAction()
*/
public boolean performAction() {
// if (checkboxViewer.getCheckedElements() == null) {
// MessageDialog.
// }
// view에 query결과를 보여준다.
NewSearchUI.runQueryInBackground(newQuery());
writeConfiguration();
return true;
}
示例3: run
import org.eclipse.search.ui.NewSearchUI; //导入方法依赖的package包/类
@Override
public void run(IAction action) {
if(namedElement == null) {
return;
}
UMLInverseReferenceModelSearch searcher = new UMLInverseReferenceModelSearch();
UMLInverseReferenceModelSearchPattern pattern = new UMLInverseReferenceModelSearchPattern((NamedElement)namedElement);
ISearchQuery query = new UMLInverseReferenceModelSearchQuery(searcher, pattern);
NewSearchUI.runQueryInBackground(query);
}
示例4: performFind
import org.eclipse.search.ui.NewSearchUI; //导入方法依赖的package包/类
private static void performFind(final String searchText, final boolean caseSensitive, final boolean isRegEx,
final FileTextSearchScope searchScope)
{
try
{
ISearchQuery query = TextSearchQueryProvider.getPreferred().createQuery(new TextSearchInput()
{
public boolean isRegExSearch()
{
return isRegEx;
}
public boolean isCaseSensitiveSearch()
{
return caseSensitive;
}
public String getSearchText()
{
return searchText;
}
public FileTextSearchScope getScope()
{
return searchScope; //$NON-NLS-1$
}
});
NewSearchUI.runQueryInBackground(query);
}
catch (CoreException e1)
{
FindBarPlugin.log(e1);
}
}
示例5: performAction
import org.eclipse.search.ui.NewSearchUI; //导入方法依赖的package包/类
@Override
public boolean performAction() {
final Criteria currentCriteria = new Criteria(searchTerm.getText(), getSelectedMatchTypes());
NewSearchUI.runQueryInBackground(new ReferenceLibrarySearchQuery(currentCriteria, resourceSet));
updateHistory(currentCriteria);
writeCriteria();
return true;
}
示例6: performAction
import org.eclipse.search.ui.NewSearchUI; //导入方法依赖的package包/类
@Override
public boolean performAction()
{
if (currentSearchPage != null && currentSearchPage.isInputValid())
{
final IJiveSearchQuery query = currentSearchPage.createSearchQuery();
NewSearchUI.runQueryInBackground(query);
return true;
}
return false;
}
示例7: doExecuteResult
import org.eclipse.search.ui.NewSearchUI; //导入方法依赖的package包/类
/**
* @see com.mulgasoft.emacsplus.commands.MinibufferExecHandler#doExecuteResult(org.eclipse.ui.texteditor.ITextEditor, java.lang.Object)
*/
public boolean doExecuteResult(ITextEditor editor, Object minibufferResult) {
TextSearchQueryProvider provider= TextSearchQueryProvider.getPreferred();
ISearchResult result = (ISearchResult)minibufferResult;
try {
ISearchQuery query= provider.createQuery(getTextInput(result.getSearchStr(),result.isCaseSensitive(),getInputObject(editor)));
if (query != null) {
// and execute the search
NewSearchUI.runQueryInBackground(query);
}
} catch (OperationCanceledException ex) {
// action canceled
} catch (CoreException e) {}
return true;
}
示例8: performAction
import org.eclipse.search.ui.NewSearchUI; //导入方法依赖的package包/类
@Override
public boolean performAction() {
ScopeAndData scopeAndData = getScopeAndData();
SearchIndexData data = new SearchIndexData(fPattern.getText(), fIsCaseSensitiveCheckbox.getSelection(),
fIsWholeWordCheckbox.getSelection(), scopeAndData.scope, scopeAndData.scopeData, "*"); // filenamePattern is always * for Python searches (we'll always be searching the whole index).
PySearchIndexQuery query = new PySearchIndexQuery(data);
NewSearchUI.runQueryInBackground(query);
searchIndexDataHistory.add(data);
searchIndexDataHistory.writeConfiguration();
return true;
}
示例9: perform
import org.eclipse.search.ui.NewSearchUI; //导入方法依赖的package包/类
@Override
protected String perform(IAction action, IProgressMonitor monitor) throws Exception {
IPyRefactoring2 r = (IPyRefactoring2) AbstractPyRefactoring.getPyRefactoring();
RefactoringRequest req = getRefactoringRequest(new NullProgressMonitor()); //as we're doing it in the background
req.fillInitialNameAndOffset();
if (req.initialName != null && req.initialName.trim().length() > 0) {
NewSearchUI.runQueryInBackground(newQuery(r, req));
}
return null;
}
示例10: performAction
import org.eclipse.search.ui.NewSearchUI; //导入方法依赖的package包/类
public boolean performAction() {
try {
NewSearchUI.activateSearchResultView();
NewSearchUI.runQueryInBackground(newQuery());
} catch (CoreException e) {
ErrorDialog.openError(getShell(), SearchMessages.TextSearchPage_replace_searchproblems_title,
SearchMessages.TextSearchPage_replace_searchproblems_message, e.getStatus());
return false;
}
return true;
}
示例11: performAction
import org.eclipse.search.ui.NewSearchUI; //导入方法依赖的package包/类
@Override
public boolean performAction() {
try {
NewSearchUI.runQueryInBackground(newQuery());
} catch (CoreException e) {
ErrorDialog.openError(getShell(), "Search",
"Problems occurred while searching. The affected files will be skipped.", e.getStatus());
return false;
}
return true;
}
示例12: open
import org.eclipse.search.ui.NewSearchUI; //导入方法依赖的package包/类
@Override
public void open() {
// Execute Search
EditorConfigSearchQuery query = new EditorConfigSearchQuery(section, configFile);
NewSearchUI.runQueryInBackground(query);
}
示例13: execute
import org.eclipse.search.ui.NewSearchUI; //导入方法依赖的package包/类
public void execute() {
NewSearchUI.activateSearchResultView();
NewSearchUI.runQueryInBackground(referenceQuery);
}
示例14: performAction
import org.eclipse.search.ui.NewSearchUI; //导入方法依赖的package包/类
@Override
public boolean performAction() {
EntrySearch.Pattern pat = new EntrySearch.Pattern(
queryStr.getText(),
isCaseSensitive.getSelection(),
isRegex.getSelection());
List<EntrySearch.Objective> objs = new ArrayList<>(10);
if(searchAsId.getSelection()) {
objs.add(EntrySearch.Objective.ID);
}
if(searchAsName.getSelection()) {
objs.add(EntrySearch.Objective.NAME);
}
if(searchAsPath.getSelection()) {
objs.add(EntrySearch.Objective.PATH);
}
if(searchAsCaption.getSelection()) {
objs.add(EntrySearch.Objective.CAPTION);
}
if(searchAsValue.getSelection()) {
objs.add(EntrySearch.Objective.VALUE);
}
String valuePath = null;
if(limitedToValuePath.isEnabled() && limitedToValuePath.getSelection()) {
valuePath = limitedToValuePathStr.getText();
}
EntrySearch.Constraint cons = new EntrySearch.Constraint(
limitedToLeaf.getSelection(),
valuePath != null ? TreePath.fromStr(valuePath) : null
);
EntrySearchQuery query = new EntrySearchQuery(pat, objs, cons);
try {
if(query.canRunInBackground()) {
NewSearchUI.runQueryInBackground(query);
}
else {
NewSearchUI.runQueryInForeground(null, query);
}
}
catch (Exception e) {
throw new RuntimeException(e);
}
return true;
}
示例15: performAction
import org.eclipse.search.ui.NewSearchUI; //导入方法依赖的package包/类
/**
* This is run when the "search" button is pressed.
*/
@Override
public boolean performAction() {
saveWidgetValues();
if(searchQueries.size() == 0){
return false;
}
searcher.clearQueries();
if(hasAllMustNotQueries()){
searcher.addQuery(PlanSearcher.DEFAULT_QUERY);
}
for(PlanSearchDialogQuery query : searchQueries){
query.getPlanSearchInput().setDefaultBooleanID(defaultBooleanOption.getSelectionIndex());
query.getPlanSearchInput().addQueries(searcher);
}
try{
ISearchResultViewPart view = NewSearchUI.activateSearchResultView();
IActionBars actionBars = view.getViewSite().getActionBars();
OperationHistoryActionHandler undoHandler = (OperationHistoryActionHandler)actionBars.getGlobalActionHandler(ActionFactory.UNDO.getId());
PlatformUI.getWorkbench().getOperationSupport().getUndoContext();
undoHandler.setContext(IOperationHistory.GLOBAL_UNDO_CONTEXT);
OperationHistoryActionHandler redoHandler = (OperationHistoryActionHandler)actionBars.getGlobalActionHandler(ActionFactory.REDO.getId());
redoHandler.setContext(IOperationHistory.GLOBAL_UNDO_CONTEXT);
String searchLabel = "";
for(int i = 0; i < searchQueries.size(); i++){
searchLabel += searchQueries.get(i).getPlanSearchInput().getSearchLabel();
if(i < searchQueries.size() - 1){
searchLabel += ",\n";
}
}
// don't run query until the indexer is finished. (stop waiting after 3 seconds).
indexingCompletedLatch.await(maximumIndexingWaitTime, TimeUnit.SECONDS);
NewSearchUI.runQueryInBackground(new PlanSearchQuery(searchLabel, searcher, indexer));
}
catch (Exception e){
LogUtil.error(e.getMessage());
System.out.println("Exception in performing search action: " + e.getMessage());
return false;
}
return true;
}