Interface CodeViewerService


  • public interface CodeViewerService
    Service provided by a plugin that shows the listing from a Program, i.e., a Code Viewer. The service allows other plugins to add components and actions local to the Code Viewer.
    • Method Detail

      • addOverviewProvider

        void addOverviewProvider​(OverviewProvider overviewProvider)
        Add a provider that shows an overview of the program.
        Parameters:
        overviewProvider - provider to add
      • removeOverviewProvider

        void removeOverviewProvider​(OverviewProvider overviewProvider)
        Remove a provider that shows an overview of the program.
        Parameters:
        overviewProvider - provider to remove
      • addMarginProvider

        void addMarginProvider​(MarginProvider marginProvider)
        Add a provider that shows markers in a program for the portion that is visible.
        Parameters:
        marginProvider - provider to add
      • removeMarginProvider

        void removeMarginProvider​(MarginProvider marginProvider)
        Remove a provider that shows markers in a program for the portion that is visible.
        Parameters:
        marginProvider - provider to remove
      • addLocalAction

        void addLocalAction​(DockingAction action)
        Add an action that is local to the Code Viewer.
        Parameters:
        action - local action to add
      • removeLocalAction

        void removeLocalAction​(DockingAction action)
        Remove the local action from the Code Viewer.
        Parameters:
        action - local action to remove
      • addProgramDropProvider

        void addProgramDropProvider​(ProgramDropProvider provider)
        Add a provider that will be notified for drag and drop actions.
        Parameters:
        provider - for drag and drop
      • addButtonPressedListener

        void addButtonPressedListener​(ButtonPressedListener listener)
        Add a listener that is notified when a mouse button is pressed.
        Parameters:
        listener -
      • removeButtonPressedListener

        void removeButtonPressedListener​(ButtonPressedListener listener)
        Remove the button pressed listener.
        Parameters:
        listener -
      • setHighlightProvider

        void setHighlightProvider​(HighlightProvider provider,
                                  Program program)
        Set the highlight provider. The existing provider is replaced with the given provider.
        Parameters:
        provider - The provider to set.
        program - The program with which to associate the given provider.
      • removeHighlightProvider

        void removeHighlightProvider​(HighlightProvider provider,
                                     Program program)
        Remove the highlight provider.
        Parameters:
        provider - the provider to remove.
        program - the program associated with the given provider.
      • setListingPanel

        void setListingPanel​(ListingPanel listingPanel)
        Set a listing panel on the code viewer.
        Parameters:
        listingPanel - the panel to add.
        listener - the listener to be notified if the new listingPanel is to be removed.
      • removeListingPanel

        void removeListingPanel​(ListingPanel listingPanel)
        Remove the given listing panel from the code viewer.
      • getView

        AddressSetView getView()
        Get Current view that the CodeViewer is showing.
      • goTo

        boolean goTo​(ProgramLocation loc,
                     boolean centerOnScreen)
        Commands the code viewer to position the cursor at the given location.
        Parameters:
        loc - the location at which to position the cursor.
        centerOnScreen - if true, the location will be placed in the center of the display window
        Returns:
        true if the location exists.
      • getFieldPanel

        FieldPanel getFieldPanel()
        Return the fieldPanel.
      • getAddressIndexMap

        AddressIndexMap getAddressIndexMap()
        Returns the current address-index-map
      • setNorthComponent

        void setNorthComponent​(javax.swing.JComponent comp)
        Place a component in the North area of the CodeViewer.
        Parameters:
        comp - component to place in the North area of the CodeViewer
      • getLayout

        Layout getLayout​(Address addr)
        Returns the Layout of Fields for the given Address.
        Parameters:
        addr - the address at which to get a Layout
      • updateDisplay

        void updateDisplay()
        tells the browser to rebuild the display.
      • getListingModel

        ListingModel getListingModel()
        Gets the current ListingLayoutModel;
        Returns:
        the current ListingLayoutModel;
      • getNavigatable

        Navigatable getNavigatable()
        Gets the navigatable for the code viewer service.
        Returns:
        the navigatable for the code viewer service.
      • getListingPanel

        ListingPanel getListingPanel()
        Get the main Listing panel for the code viewer service.
        Returns:
        the listing panel.
      • getCurrentFieldTextSelection

        java.lang.String getCurrentFieldTextSelection()
        Returns a String representing the current character-based selection of the currently selected field. If there is no selection, or if there is a ProgramSelection (which spans multiple fields), then this method will return null.

        To know which field contains the selection,

        Returns:
        the currently selected text within a given field
      • getCurrentField

        Field getCurrentField()
        Returns the current field under the cursor.
        Returns:
        the current field under the cursor.
      • getCurrentLocation

        ProgramLocation getCurrentLocation()
        Returns the current cursor location.
        Returns:
        the current cursor location.
      • getCurrentSelection

        ProgramSelection getCurrentSelection()
        Returns the current program selection (which crosses multiple fields).
        Returns:
        the current program selection.