Interface ResultsManager
@API(type=EXTENDABLE,
src=PUBLIC)
public interface ResultsManager
Manages the results of various operations. For example, the results
can be presented in a new or an already existing view/tab.
Available for the stand-alone and Eclipse plugin versions of oXygen.
The results manager can be retrieved from an instance of
Available for the stand-alone and Eclipse plugin versions of oXygen.
The results manager can be retrieved from an instance of
PluginWorkspace
(see method getResultsManager()).- Since:
- 19.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe type of the result. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventHandler(String tabKey, ResultsTabEventHandler handler) Add a handler for events from a results tab, such as clicks, double-clicks, pressing Enter on an entry, and others.voidaddPopUpMenuCustomizer(String tabKey, ResultsTabPopUpMenuCustomizer customizer) Add a pop-up menu customizer for a specific results tab.voidaddResult(String tabKey, DocumentPositionedInfo result, ResultsManager.ResultType resultType, boolean selectTab, boolean selectResult) Add a result to the view identified by the given key.voidaddResults(String tabKey, List<? extends DocumentPositionedInfo> results, ResultsManager.ResultType resultsType, boolean selectTab) Append a list of results to the view identified by the given key.getAllResults(String tabKey) Get all the results from a tab.getSelectedResults(String tabKey) Get the results that are selected in a certain tab.voidremoveEventHandler(String tabKey, ResultsTabEventHandler handler) Remove the handler from the tab identified by the given key.voidremovePopUpMenuCustomizer(String tabKey, ResultsTabPopUpMenuCustomizer customizer) Remove a pop-up menu customizer from a specific results tab.voidremoveResult(String tabKey, DocumentPositionedInfo result) Remove the given result from the tab identified by the given key.voidselectResult(String tabKey, DocumentPositionedInfo result) Select the given result from the tab identified by the given key.voidsetResults(String tabKey, List<? extends DocumentPositionedInfo> results, ResultsManager.ResultType resultsType) Set a new list of results in the view identified by the given key.
-
Method Details
-
setResults
void setResults(String tabKey, List<? extends DocumentPositionedInfo> results, ResultsManager.ResultType resultsType) Set a new list of results in the view identified by the given key. If a results view does not exist for the given key, a new one is created. The view is selected automatically when setting a list of results in it.- Parameters:
tabKey- The key identifying the view. It is set as the view's name.results- The list of new results. Ifnull, the associated view is removed.resultsType- The type of the results. One ofResultsManager.ResultType.PROBLEMorResultsManager.ResultType.GENERIC. It the type isResultsManager.ResultType.PROBLEM, the results tab will display an icon corresponding to the severity of the results, otherwise it will not.
-
addResult
void addResult(String tabKey, DocumentPositionedInfo result, ResultsManager.ResultType resultType, boolean selectTab, boolean selectResult) Add a result to the view identified by the given key. If a results view does not exist for the given key, a new one is created.- Parameters:
tabKey- The key identifying the view. It is set as the view's name.result- The result to add. Ifnull, nothing happens.resultType- The type of the result. One ofResultsManager.ResultType.PROBLEMorResultsManager.ResultType.GENERIC. It the type isResultsManager.ResultType.PROBLEM, the results tab will display an icon corresponding to the severity of the results, otherwise it will not. If for the current call of this method the tab key is the same as for the previous, but the result type changes, the tab will first be cleared, before adding the current result.selectTab-trueto select the tab when adding a result.selectResult-trueto scroll to the added result and select it, if the results tab was not already focused.
-
addResults
void addResults(String tabKey, List<? extends DocumentPositionedInfo> results, ResultsManager.ResultType resultsType, boolean selectTab) Append a list of results to the view identified by the given key. If a results view does not exist for the given key, a new one is created.- Parameters:
tabKey- The key identifying the view. It is set as the view's name.results- The list of results to append. Ifnull, nothing happens.resultsType- The type of the results. One ofResultsManager.ResultType.PROBLEMorResultsManager.ResultType.GENERIC. It the type isResultsManager.ResultType.PROBLEM, the results tab will display an icon corresponding to the severity of the results, otherwise it will not. If for the current call of this method the tab key is the same as for the previous, but the result type changes, the tab will first be cleared, before adding the current results.selectTab-trueto select the tab when adding the results.
-
getAllResults
Get all the results from a tab.- Parameters:
tabKey- The key identifying the tab from which the results are to be retrieved.- Returns:
- all the results or an empty list if the tab is empty or does not exist.
-
getSelectedResults
Get the results that are selected in a certain tab.- Parameters:
tabKey- The key identifying the tab from which the selected results are to be retrieved.- Returns:
- the selected results or an empty list if there are no results selected.
-
addEventHandler
Add a handler for events from a results tab, such as clicks, double-clicks, pressing Enter on an entry, and others.- Parameters:
tabKey- The key identifying the tab on which the handler is added.handler- The handler.
-
removeEventHandler
Remove the handler from the tab identified by the given key.- Parameters:
tabKey- The key identifying the tab from which the handler is removed.handler- The handler.
-
selectResult
Select the given result from the tab identified by the given key. The tab is also selected.- Parameters:
tabKey- The key identifying the tab.result- The result to be selected.
-
removeResult
Remove the given result from the tab identified by the given key.- Parameters:
tabKey- The key identifying the tab.result- The result to be removed.
-
addPopUpMenuCustomizer
Add a pop-up menu customizer for a specific results tab.- Parameters:
tabKey- The key identifying the tab for which the menu customizer is added.customizer- The customizer to add.
-
removePopUpMenuCustomizer
Remove a pop-up menu customizer from a specific results tab.- Parameters:
tabKey- The key identifying the tab from which the menu customizer is removed.customizer- The customizer to remove.
-