org.netbeans.spi.quicksearch 1.14

org.netbeans.spi.quicksearch
Class SearchResponse

java.lang.Object
  extended by org.netbeans.spi.quicksearch.SearchResponse

public final class SearchResponse
extends Object

Response object for collecting results of SearchProvider.evaluate(org.netbeans.spi.quicksearch.SearchRequest, org.netbeans.spi.quicksearch.SearchResponse) search operation. SearchProvider implementors are expected to fill SearchResponse in steps by calling various addResult(java.lang.Runnable, java.lang.String) methods.


Method Summary
 boolean addResult(Runnable action, String htmlDisplayName)
          Adds new result of quick search operation.
 boolean addResult(Runnable action, String htmlDisplayName, String displayHint, List<? extends KeyStroke> shortcut)
          Adds new result of quick search operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addResult

@CheckReturnValue
public boolean addResult(Runnable action,
                                          String htmlDisplayName)
Adds new result of quick search operation.

Parameters:
action - Runnable to invoke when this result item is chosen by user. Providers are expected to signal unsuccessful invocation of Runnable.run by writing into status line and producing beep. Invocation failures may happen, as Runnable.run may be called later, when conditions or context changed in a way that action can't be performed.
htmlDisplayName - Localized display name of this result item. May start with <html> in which case the text may use HTML tags; then <b>...</b> tags should be used to emphasize part of the result. Common provider implementations will use bold marking for found substring, so resulting string should look like <html>Item containing <b>searched</b> text, where searched is text returned from SearchRequest.getText(). Use of other HTML tags is discouraged. If plain text is passed, the first occurrence of the search string will be highlighted automatically.
Returns:
true when result was accepted and more results are needed if available. False when no further results are needed. SearchProvider implementors should stop computing and leave SearchProvider.evaluate(...) immediately if false is returned.

addResult

@CheckReturnValue
public boolean addResult(Runnable action,
                                          String htmlDisplayName,
                                          String displayHint,
                                          List<? extends KeyStroke> shortcut)
Adds new result of quick search operation.

Parameters:
action - Runnable to invoke when this result item is chosen by user. Providers are expected to signal unsuccessful invocation of Runnable.run by writing into status line and producing beep. Invocation failures may happen, as Runnable.run may be called later, when conditions or context changed in a way that action can't be performed.
htmlDisplayName - see addResult(Runnable,String) for description
displayHint - Localized display hint of this result item or null if not available
shortcut - Shortcut of this result item or null if shortcut isn't available
Returns:
true when result was accepted and more results are needed if available. False when no further results are needed. SearchProvider implementors should stop computing and leave SearchProvider.evaluate(...) immediately if false is returned.

org.netbeans.spi.quicksearch 1.14

Built on May 25 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.