Class ListingCodeComparisonPanel

All Implemented Interfaces:
FormatModelListener, OptionsChangeListener, ExtensionPoint, ImageObserver, MenuContainer, Serializable, Accessible

public class ListingCodeComparisonPanel extends CodeComparisonPanel implements FormatModelListener, OptionsChangeListener
Panel that displays two listings for comparison.
See Also:
  • Field Details

  • Constructor Details

    • ListingCodeComparisonPanel

      public ListingCodeComparisonPanel(String owner, PluginTool tool)
      Creates a comparison panel with two listings.
      Parameters:
      owner - the owner of this panel
      tool - the tool displaying this panel
  • Method Details

    • getComparisonComponent

      public JComponent getComparisonComponent(Duo.Side side)
      Description copied from class: CodeComparisonPanel
      Returns the Component for the given Duo.Side
      Specified by:
      getComparisonComponent in class CodeComparisonPanel
      Parameters:
      side - the Side to its component
      Returns:
      the Component for the given Duo.Side
    • getListingPanel

      public ListingPanel getListingPanel(Duo.Side side)
    • optionsChanged

      public void optionsChanged(ToolOptions options, String optionName, Object oldValue, Object newValue)
      Description copied from interface: OptionsChangeListener
      Notification that an option changed.

      Note: to reject an options change, you can throw a OptionsVetoException.

      Specified by:
      optionsChanged in interface OptionsChangeListener
      Parameters:
      options - options object containing the property that changed
      optionName - name of option that changed
      oldValue - old value of the option
      newValue - new value of the option
    • getName

      public String getName()
      Description copied from class: CodeComparisonPanel
      Force subclasses to supply a descriptive name.
      Specified by:
      getName in class CodeComparisonPanel
      Returns:
      a descriptive name for this panel type
    • setVisible

      public void setVisible(boolean b)
      Overrides:
      setVisible in class JComponent
    • addHighlightProviders

      public void addHighlightProviders(ListingHighlightProvider leftHighlightProvider, ListingHighlightProvider rightHighlightProvider)
      Adds the indicated highlight providers for the left and right listing panels.
      Parameters:
      leftHighlightProvider - the highlight provider for the left side's listing.
      rightHighlightProvider - the highlight provider for the right side's listing.
    • removeHighlightProviders

      public void removeHighlightProviders(ListingHighlightProvider leftHighlightProvider, ListingHighlightProvider rightHighlightProvider)
      Removes the indicated highlight providers from the left and right listing panels.
      Parameters:
      leftHighlightProvider - the highlight provider for the left side's listing.
      rightHighlightProvider - the highlight provider for the right side's listing.
    • getActions

      public List<DockingAction> getActions()
      Description copied from class: CodeComparisonPanel
      Returns the actions for this panel
      Overrides:
      getActions in class CodeComparisonPanel
      Returns:
      an array of docking actions
    • updateActionEnablement

      public void updateActionEnablement()
      Updates the enablement for all actions provided by this panel.
      Specified by:
      updateActionEnablement in class CodeComparisonPanel
    • setLocation

      public void setLocation(Duo.Side side, Program program, ProgramLocation location)
      Sets the cursor for the side to the given location
      Parameters:
      side - The side to goto
      program - the side's program
      location - the location
    • getActiveListingPanel

      public ListingPanel getActiveListingPanel()
    • dispose

      public void dispose()
      Description copied from class: CodeComparisonPanel
      Cleans up resources when this panel is no longer needed
      Specified by:
      dispose in class CodeComparisonPanel
    • getActionContext

      public ActionContext getActionContext(ComponentProvider provider, MouseEvent event)
      Description copied from class: CodeComparisonPanel
      Returns the context object which corresponds to the area of focus within this provider's component. Null is returned when there is no context.
      Specified by:
      getActionContext in class CodeComparisonPanel
      Parameters:
      provider - the provider that includes this code comparison component.
      event - mouse event which corresponds to this request. May be null for key-stroke or other non-mouse event.
      Returns:
      the action context for the area of focus in this component.
    • updateListings

      public void updateListings()
      Repaints both the left and right listing panels if they are visible.
    • formatModelChanged

      public void formatModelChanged(FieldFormatModel model)
      Description copied from interface: FormatModelListener
      Notifies that the given format model was changed.
      Specified by:
      formatModelChanged in interface FormatModelListener
      Parameters:
      model - the model that was changed.
    • getListingPanel

      public ListingPanel getListingPanel(FieldPanel fieldPanel)
      Gets the left or right listing panel that contains the indicated field panel.
      Parameters:
      fieldPanel - the field panel
      Returns:
      the listing panel or null.
    • setStatusInfo

      public void setStatusInfo(String text)
      Displays the indicated text int the tool's status area.
      Parameters:
      text - the message to display
    • getContextObjectForMarginPanels

      public Object getContextObjectForMarginPanels(ListingPanel panel, MouseEvent event)
      Gets a marker margin or overview margin context object if the mouse event occurred on one of the GUI components for the indicated listing panel's marker margin (left edge of listing) or overview margin (right edge of listing).
      Parameters:
      panel - The listing panel to check
      event - the mouse event
      Returns:
      a marker margin context object if the event was on a margin.
    • setSynchronizedScrolling

      public void setSynchronizedScrolling(boolean synchronize)
      Description copied from class: CodeComparisonPanel
      Sets whether or not scrolling is synchronized.
      Specified by:
      setSynchronizedScrolling in class CodeComparisonPanel
      Parameters:
      synchronize - true means synchronize scrolling between the two views.
    • comparisonDataChanged

      protected void comparisonDataChanged()
      Description copied from class: CodeComparisonPanel
      Notification to subclasses that the comparison data has changed
      Specified by:
      comparisonDataChanged in class CodeComparisonPanel