Invoked when the user want to search for a SARL runtime environment.
516656
protected void handleInstalledSREsButtonSelected() {
		PreferencesUtil.createPreferenceDialogOn(
				getControl().getShell(),
				SREsPreferencePage.ID,
				new String[] {SREsPreferencePage.ID},
				null).open();
	}
1161889
private static void checkResource(final List<String> resources, final Pattern searchPattern, final String resourceName) {
        if (searchPattern.matcher(resourceName).matches()) {
            resources.add(resourceName);
        }
    }
1250548
public void updateEnableState() {
		boolean comboEnabled = !this.runtimeEnvironments.isEmpty();
		boolean searchEnabled = true;
		if (isSystemWideDefaultSRE() || isProjectSRE()) {
			comboEnabled = false;
			searchEnabled = false;
		}
		this.runtimeEnvironmentCombo.setEnabled(comboEnabled);
		this.runtimeEnvironmentSearchButton.setEnabled(searchEnabled);
	}
738154
public void onSearchRequested(SearchRequestEvent event) {
		final SearchEvent searchEvent = new SearchEvent();
		searchEvent.setCriterion(event.getCriterion());
		fireSearchStartEvent(searchEvent);
		SearchCommService.searchByCriterion(event.getCriterion(), mapWidget,
				new DataCallback<Map<VectorLayer, List<Feature>>>() {
					public void execute(Map<VectorLayer, List<Feature>> result) {
						searchEvent.setResult(result);
						fireSearchDoneEvent(searchEvent);
						fireSearchEndEvent(searchEvent);
					}
				}, new Runnable() {
					public void run() {
						fireSearchEndEvent(searchEvent);
						destroyWindow();
						SC.say(messages.searchControllerFailureMessage());
					}
				});
	}
1116214
def run_with_search(model_path, config, num_days):
    """"""
    from indra.tools.machine.machine import run_with_search_helper
    run_with_search_helper(model_path, config, num_days=num_days)
1343957
function onSearchEntry(entry) {
    log.trace('onSearchEntry(%j)', entry);
    var result = entry.object;
    delete result.controls; // Remove the controls array returned as part of the SearchEntry

    // Some attributes can have range attributes (paging). Execute the query
    // again to get additional items.
    pendingRangeRetrievals++;
    parseRangeAttributes.call(self, result, opts, function(err, item) {
      pendingRangeRetrievals--;

      if (err) item = entry.object;
      entryParser(item, entry.raw, function(item) {
        if (item) results.push(item);
        if ((! pendingRangeRetrievals) && (isDone)) {
          onSearchEnd();
        }
      });
    });
  }
227774
def _cached_search_compile(pattern, re_verbose, re_version, pattern_type):
    """"""

    return _bregex_parse._SearchParser(pattern, re_verbose, re_version).parse()
721644
public void runtimeEventOccurred(RuntimeEvent event)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) 
      SibTr.debug(tc, "runtimeEventOccurred", event);
  }
365165
public function detect() {
		// Deprecated - the vendor libs are far more accurate and up to date
		if (!$this->_config['engine']) {
			if (isset($this->Controller->RequestHandler)) {
				return $this->Controller->getRequest()->is('mobile') || $this->Controller->RequestHandler->accepts('wap');
			}
			return $this->Controller->getRequest()->is('mobile');
		}
		if (is_callable($this->_config['engine'])) {
			return call_user_func($this->_config['engine']);
		}
		throw new RuntimeException(sprintf('Engine %s not available', $this->_config['engine']));
	}
116116
public void executeSearch(boolean replaceOldTab, boolean freshQuery)
  {
    if (freshQuery)
    {
      getState().getOffset().setValue(0l);
      getState().getSelectedMatches().setValue(new TreeSet<Long>());
      // get the value for the visible segmentation from the configured context
      Set<String> selectedCorpora = getState().getSelectedCorpora().getValue();
      CorpusConfig config = new CorpusConfig();
      if(selectedCorpora != null && !selectedCorpora.isEmpty())
      {
        config = ui.getCorpusConfigWithCache(selectedCorpora.iterator().next());
      }

      if(config.containsKey(SearchOptionsPanel.KEY_DEFAULT_BASE_TEXT_SEGMENTATION))
      {
        String configVal = config.getConfig(SearchOptionsPanel.KEY_DEFAULT_BASE_TEXT_SEGMENTATION);
        if("".equals(configVal) || "tok".equals(configVal))
        {
          configVal = null;
        }
        getState().getVisibleBaseText().setValue(configVal);
      }
      else
      {
        getState().getVisibleBaseText().setValue(getState().getContextSegmentation().getValue());
      }
    }
    // construct a query from the current properties
    DisplayedResultQuery displayedQuery = getSearchQuery();

    searchView.getControlPanel().getQueryPanel().setStatus("Searching...");

    cancelSearch();

    // cleanup resources
    VaadinSession session = VaadinSession.getCurrent();
    session.setAttribute(IFrameResourceMap.class, new IFrameResourceMap());
    if (session.getAttribute(MediaController.class) != null)
    {
      session.getAttribute(MediaController.class).clearMediaPlayers();
    }

    searchView.updateFragment(displayedQuery);


    if (displayedQuery.getCorpora() == null || displayedQuery.getCorpora().
      isEmpty())
    {
      Notification.show("Please select a corpus",
        Notification.Type.WARNING_MESSAGE);
      return;
    }
    if ("".equals(displayedQuery.getQuery()))
    {
      Notification.show("Empty query", Notification.Type.WARNING_MESSAGE);
      return;
    }
    
    addHistoryEntry(displayedQuery);

    AsyncWebResource res = Helper.getAnnisAsyncWebResource();

    //
    // begin execute match fetching
    //
    ResultViewPanel oldPanel = searchView.getLastSelectedResultView();
    if (replaceOldTab)
    {
      // remove old panel from view
      searchView.closeTab(oldPanel);
    }

    ResultViewPanel newResultView = new ResultViewPanel(ui, ui,
      ui.getInstanceConfig(), displayedQuery);
    newResultView.getPaging().addCallback(new SpecificPagingCallback(
      ui, searchView, newResultView, displayedQuery));

    TabSheet.Tab newTab;

    List<ResultViewPanel> existingResultPanels = getResultPanels();
    String caption = existingResultPanels.isEmpty()
      ? "Query Result" : "Query Result #" + (existingResultPanels.size() + 1);

    newTab = searchView.getMainTab().addTab(newResultView, caption);
    newTab.setClosable(true);
    newTab.setIcon(FontAwesome.SEARCH);

    searchView.getMainTab().setSelectedTab(newResultView);
    searchView.notifiyQueryStarted();

    Background.run(new ResultFetchJob(displayedQuery,
      newResultView, ui));

    //
    // end execute match fetching
    //
    // 
    // begin execute count
    //
    // start count query
    searchView.getControlPanel().getQueryPanel().setCountIndicatorEnabled(true);

    AsyncWebResource countRes = res.path("query").path("search").
      path("count").
      queryParam("q", Helper.encodeJersey(displayedQuery.getQuery()))
      .queryParam("corpora", Helper.encodeJersey(StringUtils.join(displayedQuery.getCorpora(), ",")));
    Future<MatchAndDocumentCount> futureCount = countRes.get(
        MatchAndDocumentCount.class);
    state.getExecutedTasks().put(QueryUIState.QueryType.COUNT, futureCount);

    Background.run(new CountCallback(newResultView, displayedQuery.getLimit(), ui));

    //
    // end execute count
    //
  }
1129861
public void setSearchManager(CmsSearchManager manager) {

        m_searchManager = manager;
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_SEARCH_MANAGER_FINISHED_0));
        }
    }
204115
function addonsManager_waitForSearchFinished(aSpec) {
    var spec = aSpec || { };
    var timeout = (spec.timeout == undefined) ? TIMEOUT_SEARCH : spec.timeout;

    // TODO: restore after 1.5.1 has landed
    // var self = this;
    // 
    // mozmill.utils.waitFor(function () {
    //   return self.isSearching == false;
    // }, timeout, 100, "Search has been finished");
    
    mozmill.utils.waitForEval("subject.isSearching == false", 
                              timeout, 100, this);
  }
464186
protected function doFileSearch()
    {
        if (empty($this->searchLocations)) {
            throw new \RuntimeException(
                'No search locations have been defined.'
            );
        }

        return (new Finder())
            ->name($this->searchPattern)
            ->in($this->searchLocations)
            ->depth($this->searchDepth)
            ->files();
    }
665645
private void executeSearch(CmsSearchController controller, CmsSolrQuery query) {

        CmsObject cms = A_CmsUI.getCmsObject();
        CmsSolrIndex index = OpenCms.getSearchManager().getIndexSolr(
            cms.getRequestContext().getCurrentProject().isOnlineProject()
            ? CmsSolrIndex.DEFAULT_INDEX_NAME_ONLINE
            : CmsSolrIndex.DEFAULT_INDEX_NAME_OFFLINE);
        try {
            CmsSolrResultList solrResultList = index.search(cms, query, true, CmsResourceFilter.IGNORE_EXPIRATION);
            displayResult(solrResultList);
            m_resultFacets.displayFacetResult(
                solrResultList,
                new CmsSearchResultWrapper(controller, solrResultList, query, cms, null));
        } catch (CmsSearchException e) {
            CmsErrorDialog.showErrorDialog(e);

            LOG.error("Error executing search.", e);
        }
    }
797624
public void searchElement(final String path, final Runnable nextAction) {

        m_dialogBean.setCurrentElement(path);
        m_dialogBean.setStartTab(GalleryTabId.cms_tab_results);
        m_dialogBean.setTreeToken(getTreeToken());

        CmsRpcAction<CmsGallerySearchBean> searchAction = new CmsRpcAction<CmsGallerySearchBean>() {

            @Override
            public void execute() {

                start(200, true);
                getGalleryService().getSearch(m_dialogBean, this);
            }

            @Override
            protected void onResponse(CmsGallerySearchBean result) {

                stop(false);
                m_searchObject = result;
                m_handler.onInitialSearch(result, m_dialogBean, CmsGalleryController.this, false);
                if (nextAction != null) {
                    nextAction.run();
                }
            }

        };
        searchAction.execute();
    }
402896
function run_search(query) {
      	 var cache_key = query + computeURL();
          //var cached_results = cache.get(cache_key);
          /*if (cached_results) {
              if ($.isFunction($(input).data("settings").onCachedResult)) {
                cached_results = $(input).data("settings").onCachedResult.call(hidden_input, cached_results);
              }
              populate_dropdown(query, cached_results);
          } else {*/
              // Are we doing an ajax search or local data search?
              if($(input).data("settings").url) {
                  var url = computeURL();
                  // Extract existing get params
                  var ajax_params = {};
                  ajax_params.data = {};
                  if(url.indexOf("?") > -1) {
                      var parts = url.split("?");
                      ajax_params.url = parts[0];

                      var param_array = parts[1].split("&");
                      $.each(param_array, function (index, value) {
                          var kv = value.split("=");
                          ajax_params.data[kv[0]] = kv[1];
                      });
                  } else {
                      ajax_params.url = url;
                  }

                  // Prepare the request
                  ajax_params.data[$(input).data("settings").queryParam] = query;
                  ajax_params.type = $(input).data("settings").method;
                  ajax_params.dataType = $(input).data("settings").contentType;
                  if ($(input).data("settings").crossDomain) {
                      ajax_params.dataType = "jsonp";
                  }

                  // exclude current tokens?
                  // send exclude list to the server, so it can also exclude existing tokens
                  if ($(input).data("settings").excludeCurrent) {
                      var currentTokens = $(input).data("tokenInputObject").getTokens();
                      var tokenList = $.map(currentTokens, function (el) {
                          if(typeof $(input).data("settings").tokenValue == 'function')
                              return $(input).data("settings").tokenValue.call(this, el);

                          return el[$(input).data("settings").tokenValue];
                      });

                      ajax_params.data[$(input).data("settings").excludeCurrentParameter] = tokenList.join($(input).data("settings").tokenDelimiter);
                  }

                  // Attach the success callback
                  ajax_params.success = function(results) {
                    cache.add(cache_key, $(input).data("settings").jsonContainer ? results[$(input).data("settings").jsonContainer] : results);
                    if($.isFunction($(input).data("settings").onResult)) {
                        results = $(input).data("settings").onResult.call(hidden_input, results);
                    }

                    // only populate the dropdown if the results are associated with the active search query
                    if(input_box.val() === query) {
                        populate_dropdown(query, $(input).data("settings").jsonContainer ? results[$(input).data("settings").jsonContainer] : results);
                    }
                  };

                  // Provide a beforeSend callback
                  if (settings.onSend) {
                    settings.onSend(ajax_params);
                  }

                  // Make the request
                  $.ajax(ajax_params);
              } else if($(input).data("settings").local_data) {
                  // Do the search through local data
                 var results = $.grep($(input).data("settings").local_data, function (row) {
                      return row[$(input).data("settings").propertyToSearch].toLowerCase().indexOf(query.toLowerCase()) > -1;
                  });

                  cache.add(cache_key, results);
                  if($.isFunction($(input).data("settings").onResult)) {
                      results = $(input).data("settings").onResult.call(hidden_input, results);
                  }
                  populate_dropdown(query, results);
              }
          //}
      }
479689
@SuppressWarnings({"WeakerAccess", "unused"}) // For library users
    public void registerSearchView(@NonNull final Activity activity, @NonNull final SearchView searchView) {
        registerSearchView(activity, new SearchViewFacade(searchView));
    }