Eclipse Platform
2.0

org.eclipse.search.ui
Class SearchUI

java.lang.Object
  |
  +--org.eclipse.search.ui.SearchUI

public final class SearchUI
extends Object

The central class for access to the Search Plug-in's User Interface. This class cannot be instantiated; all functionality is provided by static methods. Features provided:

See Also:
ISearchResultView

Field Summary
static String ACTION_SET_ID
          Id of the Search action set (value "org.eclipse.search.searchActionSet").
static String LINE
          Line marker attribute (value "line") The value of the marker attribute is the line which contains the text search match.
static String PLUGIN_ID
          Search Plug-in Id (value "org.eclipse.search").
static String POTENTIAL_MATCH
          Potential match marker attribute (value "potentialMatch").
static String SEARCH_MARKER
          Search marker type (value "org.eclipse.search.searchmarker").
static String SEARCH_RESULT_VIEW_ID
          Id of the Search result view (value "org.eclipse.search.SearchResultView").
 
Method Summary
static boolean activateSearchResultView()
          Activates the search result view in the active page of the active workbench window.
static Image getSearchMarkerImage()
          Returns the shared search marker image.
static ISearchResultView getSearchResultView()
          Returns the search result view of the active page of the active workbench window.
static void openSearchDialog(IWorkbenchWindow window, String pageId)
          Opens the search dialog.
static boolean reuseEditor()
          Returns the preference whether editors should be reused when showing search results.
 
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

LINE

public static final String LINE
Line marker attribute (value "line") The value of the marker attribute is the line which contains the text search match.

See Also:
IMarker.getAttribute(java.lang.String), Constant Field Values

POTENTIAL_MATCH

public static final String POTENTIAL_MATCH
Potential match marker attribute (value "potentialMatch").

This optional marker attribute tells whether a marker is a potential or an exact match. The marker is considered an exact match if the attribute is missing.

Potential matches are shown with a different background color in the Search view. The color can be changed in the Search preferences.

Since:
2.0
See Also:
IMarker.getAttribute(java.lang.String), Constant Field Values

SEARCH_RESULT_VIEW_ID

public static final String SEARCH_RESULT_VIEW_ID
Id of the Search result view (value "org.eclipse.search.SearchResultView").

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").

Since:
2.0
See Also:
Constant Field Values
Method Detail

activateSearchResultView

public static boolean activateSearchResultView()
Activates the search result view in the active page of the active workbench window. This call has no effect (but returns true if the search result view is already activated.

Returns:
true if the search result view could be activated

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:
pageId - the page to select or null if the best fitting page should be selected
Since:
2.0

getSearchResultView

public static ISearchResultView getSearchResultView()
Returns the search result view of the active page of the active workbench window.

Returns:
the search result view or null if there is no active search result view

getSearchMarkerImage

public static Image getSearchMarkerImage()
Returns the shared search marker image. Normally, editors show this icon in their vertical ruler. This image is owned by the search UI plug-in and must not be disposed by clients.

Returns:
the shared image

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.

[Issue: Work in progress - not yet stable.]

[Issue: Always returns true yet due to bug 6784.]

[Issue: Bug is now fixed. But because it is not yet clear if old style should be supported. Therefore returning false]

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

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.