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 PluginWorkspace (see method getResultsManager()).
    Since:
    19.0
    • Method Detail

      • setResults

        void setResults​(java.lang.String tabKey,
                        java.util.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. If null, the associated view is removed.
        resultsType - The type of the results. One of ResultsManager.ResultType.PROBLEM or ResultsManager.ResultType.GENERIC. It the type is ResultsManager.ResultType.PROBLEM, the results tab will display an icon corresponding to the severity of the results, otherwise it will not.
      • addResult

        void addResult​(java.lang.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. If null, nothing happens.
        resultType - The type of the result. One of ResultsManager.ResultType.PROBLEM or ResultsManager.ResultType.GENERIC. It the type is ResultsManager.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 - true to select the tab when adding a result.
        selectResult - true to scroll to the added result and select it, if the results tab was not already focused.
      • addResults

        void addResults​(java.lang.String tabKey,
                        java.util.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. If null, nothing happens.
        resultsType - The type of the results. One of ResultsManager.ResultType.PROBLEM or ResultsManager.ResultType.GENERIC. It the type is ResultsManager.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 - true to select the tab when adding the results.
      • getAllResults

        java.util.List<DocumentPositionedInfo> getAllResults​(java.lang.String tabKey)
        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

        java.util.List<DocumentPositionedInfo> getSelectedResults​(java.lang.String tabKey)
        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

        void addEventHandler​(java.lang.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.
        Parameters:
        tabKey - The key identifying the tab on which the handler is added.
        handler - The handler.
      • removeEventHandler

        void removeEventHandler​(java.lang.String tabKey,
                                ResultsTabEventHandler handler)
        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

        void selectResult​(java.lang.String tabKey,
                          DocumentPositionedInfo result)
        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

        void removeResult​(java.lang.String tabKey,
                          DocumentPositionedInfo result)
        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

        void addPopUpMenuCustomizer​(java.lang.String tabKey,
                                    ResultsTabPopUpMenuCustomizer customizer)
        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

        void removePopUpMenuCustomizer​(java.lang.String tabKey,
                                       ResultsTabPopUpMenuCustomizer customizer)
        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.