org.netbeans.spi.quicksearch 1.6.1

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

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. Note that <b> and </b> html 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 "Item containing <b>searched</b> text", where "searched" is text returned from SearchRequest.getText().

It's possible but not recommended to use other basic html tags, as readability of results may suffer.

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(...) immediatelly if false is returned.

addResult

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 - Localized display name of this result item. Note that <b> and </b> html 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 "Item containing <b>searched</b> text", where "searched" is text returned from SearchRequest.getText().

It's possible but not recommended to use other basic html tags, as readability of results may suffer.

displayHint - Localized display hint of this result item or null if not available

shortcut - Shortcut of this result item or null if shorcut 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(...) immediatelly if false is returned.

org.netbeans.spi.quicksearch 1.6.1

Built on November 27 2010.  |  Portions Copyright 1997-2010 Sun Microsystems, Inc. All rights reserved.