Package org.eclipse.search.ui
Interface ISearchPageContainer
public interface ISearchPageContainer
Offers client access to the search dialog.
A search page can enable or disable the dialog's action
button and get an operation context to perform the action.
The dialog itself cannot be accessed directly.
This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Current Project scope (value4
).static final int
Current Project scope (value3
).static final int
Selection scope (value1
).static final int
Working set scope (value2
).static final int
Workspace scope (value0
). -
Method Summary
Modifier and TypeMethodDescriptionReturns the editor input of the active editor.Returns the context for the search operation.String[]
Returns the names of the enclosing projects if selected by the container ornull
if the scope is notSELECTED_PROJECTS_SCOPE
int
Returns search container's selected scope.Returns the selected working sets of this container.Returns the selection with which this container was opened.boolean
Tells whether a valid scope is selected.void
setActiveEditorCanProvideScopeSelection
(boolean state) Tells this container whether the active editor can provide the selection for the scope and hence theSELECTION_SCOPE
can be enabled if the active part is an editor.void
setPerformActionEnabled
(boolean state) Sets the enable state of the perform action button of this container.void
setSelectedScope
(int scope) Sets the selected scope of this search page container.void
setSelectedWorkingSets
(IWorkingSet[] workingSets) Sets the selected working sets of this container.
-
Field Details
-
WORKSPACE_SCOPE
static final int WORKSPACE_SCOPEWorkspace scope (value0
).- Since:
- 2.0
- See Also:
-
SELECTION_SCOPE
static final int SELECTION_SCOPESelection scope (value1
).- Since:
- 2.0
- See Also:
-
WORKING_SET_SCOPE
static final int WORKING_SET_SCOPEWorking set scope (value2
).- Since:
- 2.0
- See Also:
-
SELECTED_PROJECTS_SCOPE
static final int SELECTED_PROJECTS_SCOPECurrent Project scope (value3
).- Since:
- 3.0
- See Also:
-
OPENED_EDITORS_SCOPE
static final int OPENED_EDITORS_SCOPECurrent Project scope (value4
).- Since:
- 3.16
- See Also:
-
-
Method Details
-
getSelection
ISelection getSelection()Returns the selection with which this container was opened.- Returns:
- the selection passed to this container when it was opened
-
getRunnableContext
IRunnableContext getRunnableContext()Returns the context for the search operation. This context allows progress to be shown inside the search dialog.- Returns:
- the
IRunnableContext
for the search operation
-
setPerformActionEnabled
void setPerformActionEnabled(boolean state) Sets the enable state of the perform action button of this container.- Parameters:
state
-true
to enable the button which performs the action
-
getSelectedScope
int getSelectedScope()Returns search container's selected scope. The scope is WORKSPACE_SCOPE, SELECTED_PROJECTS_SCOPE, SELECTION_SCOPE, OPENED_EDITORS_SCOPE or WORKING_SET_SCOPE.- Returns:
- the selected scope
- Since:
- 2.0
-
setSelectedScope
void setSelectedScope(int scope) Sets the selected scope of this search page container. The scope is WORKSPACE_SCOPE, SELECTED_PROJECTS_SCOPE, SELECTION_SCOPE, OPENED_EDITORS_SCOPE or WORKING_SET_SCOPE.- Parameters:
scope
- the newly selected scope- Since:
- 2.0
-
hasValidScope
boolean hasValidScope()Tells whether a valid scope is selected.- Returns:
- a
true
if a valid scope is selected in this search page container - Since:
- 2.0
-
setActiveEditorCanProvideScopeSelection
void setActiveEditorCanProvideScopeSelection(boolean state) Tells this container whether the active editor can provide the selection for the scope and hence theSELECTION_SCOPE
can be enabled if the active part is an editor.- Parameters:
state
-true
if the active editor can provide the selection,false
otherwise- Since:
- 3.7
-
getActiveEditorInput
IEditorInput getActiveEditorInput()Returns the editor input of the active editor.- Returns:
- the editor input or
null
if the active part is not an editor - Since:
- 3.7
-
getSelectedWorkingSets
IWorkingSet[] getSelectedWorkingSets()Returns the selected working sets of this container.- Returns:
- an array with the selected working sets or
null
if the scope is notWORKING_SET_SCOPE
- Since:
- 2.0
-
setSelectedWorkingSets
Sets the selected working sets of this container.- Parameters:
workingSets
- an array of IWorkingSet- Since:
- 2.0
-
getSelectedProjectNames
String[] getSelectedProjectNames()Returns the names of the enclosing projects if selected by the container ornull
if the scope is notSELECTED_PROJECTS_SCOPE
- Returns:
- the names of the enclosing project or
null
if the scope is notSELECTED_PROJECTS_SCOPE
. - Since:
- 3.2
-