Class SideBySideDiffPanel

    • Field Detail

      • MAX_LABEL_LENGTH

        public static final int MAX_LABEL_LENGTH
        the max length for label text.
        See Also:
        Constant Field Values
      • m_TextLeft

        protected DiffTextPane m_TextLeft
        the left content.
      • m_ScrollPaneLeft

        protected BaseScrollPane m_ScrollPaneLeft
        the scroll pane for the left content.
      • m_PanelLeft

        protected BasePanel m_PanelLeft
        the panel for the left content.
      • m_LabelLeft

        protected JLabel m_LabelLeft
        the label for the left content.
      • m_LabelTextLeft

        protected String m_LabelTextLeft
        the text for the left content.
      • m_TextRight

        protected DiffTextPane m_TextRight
        the right content.
      • m_ScrollPaneRight

        protected BaseScrollPane m_ScrollPaneRight
        the scroll pane for the right content.
      • m_PanelRight

        protected BasePanel m_PanelRight
        the panel for the right content.
      • m_LabelRight

        protected JLabel m_LabelRight
        the label for the right content.
      • m_LabelTextRight

        protected String m_LabelTextRight
        the text for the right content.
      • m_PanelAll

        protected BaseSplitPane m_PanelAll
        for the two sides of a diff.
      • m_IgnoreViewportChangesLeft

        protected boolean m_IgnoreViewportChangesLeft
        whether to ignore viewport changes for the left panel.
      • m_IgnoreViewportChangesRight

        protected boolean m_IgnoreViewportChangesRight
        whether to ignore viewport changes for the right panel.
      • m_LastFileLeft

        protected File m_LastFileLeft
        the last left file.
      • m_LastFileRight

        protected File m_LastFileRight
        the last right file.
    • Constructor Detail

      • SideBySideDiffPanel

        public SideBySideDiffPanel()
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class BasePanel
      • initGUI

        protected void initGUI()
        Initializes the widgets.
        Overrides:
        initGUI in class BasePanel
      • finishInit

        protected void finishInit()
        Description copied from class: BasePanel
        finishes the initialization.
        Overrides:
        finishInit in class BasePanel
      • resetLastFiles

        protected void resetLastFiles()
        Resets the files last used.
      • getPanel

        public BasePanel getPanel​(boolean left)
        Returns the underlying panel.
        Parameters:
        left - if true the panel with the left content is returned otherwise the right one
      • getDiffTextPane

        public DiffTextPane getDiffTextPane​(boolean left)
        Returns the underlying diff pane.
        Parameters:
        left - if true the pane with the left content is returned otherwise the right one
      • setLabelText

        public void setLabelText​(boolean left,
                                 String text)
        Sets the text of the label.
        Parameters:
        left - whether to set the label of the left content or the right one
        text - the text to set
      • getLabelText

        public String getLabelText​(boolean left)
        Returns the text of the label.
        Parameters:
        left - whether to get the label of the left content or the right one
        Returns:
        the current label text
      • showTextLabelPopupMenu

        protected void showTextLabelPopupMenu​(MouseEvent e,
                                              boolean left)
        Shows popup menu for text labels showing the filename.
        Parameters:
        e - the mouse event
        left - whether left or right label
      • anyDifference

        public boolean anyDifference​(File file1,
                                     File file2)
        Checks whether the two files are the same.
        Parameters:
        file1 - the left file
        file2 - the right file
        Returns:
        true if the same
      • anyDifference

        public boolean anyDifference​(String[] list1,
                                     String[] list2)
        Checks whether the two array are the same.
        Parameters:
        list1 - the left array
        list2 - the right array
        Returns:
        true if the same
      • anyDifference

        public boolean anyDifference​(List<String> list1,
                                     List<String> list2)
        Checks whether the two lists are the same.
        Parameters:
        list1 - the left list
        list2 - the right list
        Returns:
        true if the same
      • compare

        public void compare​(File file1,
                            File file2)
        Displays the diff of the two files.
        Parameters:
        file1 - the left file
        file2 - the right file
      • compare

        public void compare​(String[] list1,
                            String[] list2)
        Displays the diff of the two arrays.
        Parameters:
        list1 - the left array
        list2 - the right array
      • compare

        public void compare​(List<String> list1,
                            List<String> list2)
        Displays the diff of the two lists.
        Parameters:
        list1 - the left list
        list2 - the right list
      • setLastFileLeft

        public void setLastFileLeft​(File file)
        Sets the last left file - does not update.
        Parameters:
        file - the new left file, null to reset
      • updateLeft

        public void updateLeft​(File file)
        Updates the left file.
        Parameters:
        file - the new left file
      • setLastFileRight

        public void setLastFileRight​(File file)
        Sets the last right file - does not update.
        Parameters:
        file - the new left file, null to reset
      • updateRight

        public void updateRight​(File file)
        Updates the right file.
        Parameters:
        file - the new right file
      • clear

        public void clear()
        Clears the display.
      • display

        public void display​(DiffUtils.SideBySideDiff diff)
        Updates the display with the given diff data.
        Parameters:
        diff - the diff data to display
      • getCurrent

        public DiffUtils.SideBySideDiff getCurrent()
        Returns the currently displayed diff.
        Returns:
        the diff information