Overview

 
Package  Use  Tree  Deprecated  Index  Help 
Eclipse Platform
Release 3.0
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


 

org.eclipse.search.ui
Class NewSearchUI

java.lang.Object
  extended byorg.eclipse.search.ui.NewSearchUI


public class NewSearchUI
extends Object

A facade for access to the new search UI facilities.

Since:
3.0


Field Summary
static String ACTION_SET_ID
          Id of the Search action set (value "org.eclipse.search.searchActionSet").
static String PLUGIN_ID
          Search Plug-in Id (value "org.eclipse.search").
static String SEARCH_MARKER
          Search marker type (value "org.eclipse.search.searchmarker").
static String SEARCH_VIEW_ID
          Id of the new Search view (value "org.eclipse.search.ui.views.SearchView").
 
Constructor Summary
NewSearchUI()
           
 
Method Summary
static ISearchResultViewPart activateSearchResultView()
          Activates a search result view in the current workbench window page.
static void addQueryListener(IQueryListener l)
          Registers the given listener to receive notification of changes to queries.
static boolean arePotentialMatchesIgnored()
          Returns the preference whether a search engine is allowed to report potential matches or not.
static String getDefaultPerspectiveId()
          Returns the ID of the default perspective.
static ISearchQuery[] getQueries()
          Returns all search queries know to the search UI (i.e. registered via runQuery() or runQueryInForeground()).
static ISearchResultViewPart getSearchResultView()
          Gets the search result view shown in the current workbench window.
static boolean isQueryRunning(ISearchQuery query)
          Returns whether the given query is currently running.
static void openSearchDialog(IWorkbenchWindow window, String pageId)
          Opens the search dialog.
static void removeQueryListener(IQueryListener l)
          Removes the given query listener.
static boolean reuseEditor()
          Returns the preference whether editors should be reused when showing search results.
static void runQuery(ISearchQuery query)
          Runs the given search query.
static IStatus runQueryInForeground(IRunnableContext context, ISearchQuery query)
          Runs the given search query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

 

Field Detail

 

 

PLUGIN_ID

public static final String PLUGIN_ID

Search Plug-in Id (value "org.eclipse.search").

See Also:
Constant Field Values


 

 

SEARCH_MARKER

public static final String SEARCH_MARKER

Search marker type (value "org.eclipse.search.searchmarker").

See Also:
IMarker, Constant Field Values


 

 

SEARCH_VIEW_ID

public static final String SEARCH_VIEW_ID

Id of the new Search view (value "org.eclipse.search.ui.views.SearchView").

See Also:
Constant Field Values


 

 

ACTION_SET_ID

public static final String ACTION_SET_ID

Id of the Search action set (value "org.eclipse.search.searchActionSet").

See Also:
Constant Field Values
Constructor Detail

 

 

NewSearchUI

public NewSearchUI()

Method Detail

 

 

activateSearchResultView

public static ISearchResultViewPart activateSearchResultView()

Activates a search result view in the current workbench window page. If a search view is already open in the current workbench window page, it is activated. Otherwise a new search view is opened and activated.

Returns:
the activate search result view or null if the search result view couldn't be activated


 

 

getSearchResultView

public static ISearchResultViewPart getSearchResultView()

Gets the search result view shown in the current workbench window.

Returns:
the search result view or null, if none is open in the current workbench window page


 

 

runQuery

public static void runQuery(ISearchQuery query)

Runs the given search query. This method may run the given query in a separate thread if ISearchQuery#canRunInBackground() returns true. Running a query adds it to the set of known queries and notifies any registered IQueryListeners about the addition.

Parameters:
query - the query to execute


 

 

runQueryInForeground

public static IStatus runQueryInForeground(IRunnableContext context,
                                           ISearchQuery query)

Runs the given search query. This method will execute the query in the same thread as the caller. This method blocks until the query is finished. Running a query adds it to the set of known queries and notifies any registered IQueryListeners about the addition.

Parameters:
context - the runnable context to run the query in
query - the query to execute
Returns:
a status indicating whether the query ran correctly


 

 

addQueryListener

public static void addQueryListener(IQueryListener l)

Registers the given listener to receive notification of changes to queries. The listener will be notified whenever a query has been added, removed, is starting or has finished. Has no effect if an identical listener is already registered.

Parameters:
l - the listener to be added


 

 

removeQueryListener

public static void removeQueryListener(IQueryListener l)

Removes the given query listener. Does nothing if the listener is not present.

Parameters:
l - the listener to be removed.


 

 

getQueries

public static ISearchQuery[] getQueries()

Returns all search queries know to the search UI (i.e. registered via runQuery() or runQueryInForeground()).

Returns:
all search results


 

 

isQueryRunning

public static boolean isQueryRunning(ISearchQuery query)

Returns whether the given query is currently running. Queries may be run by client request or by actions in the search UI.

Parameters:
query - the query
Returns:
whether the given query is currently running
See Also:
runQuery(ISearchQuery), runQueryInForeground(IRunnableContext, ISearchQuery)


 

 

openSearchDialog

public static void openSearchDialog(IWorkbenchWindow window,
                                    String pageId)

Opens the search dialog. If pageId is specified and a corresponding page is found then it is brought to top.

Parameters:
window - the parent window
pageId - the page to select or null if the best fitting page should be selected


 

 

reuseEditor

public static boolean reuseEditor()

Returns the preference whether editors should be reused when showing search results. The goto action can decide to use or ignore this preference.

Returns:
true if editors should be reused for showing search results


 

 

arePotentialMatchesIgnored

public static boolean arePotentialMatchesIgnored()

Returns the preference whether a search engine is allowed to report potential matches or not.

Search engines which can report inexact matches must respect this preference i.e. they should not report inexact matches if this method returns true

Returns:
true if search engine must not report inexact matches


 

 

getDefaultPerspectiveId

public static String getDefaultPerspectiveId()

Returns the ID of the default perspective.

The perspective with this ID will be used to show the Search view. If no default perspective is set then the Search view will appear in the current perspective.

Returns:
the ID of the default perspective null if no default perspective is set


 

Overview

 
Package  Use  Tree  Deprecated  Index  Help 
Eclipse Platform
Release 3.0
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.