Class MainFrameModel


  • public class MainFrameModel
    extends java.lang.Object
    Model for checkstyle frame.
    • Constructor Detail

    • Method Detail

      • getText

        public java.lang.String getText()
        Get text to display in a text area.
        Returns:
        text to display in a text area.
      • getTitle

        public java.lang.String getTitle()
        Returns title for the main frame.
        Returns:
        title for the main frame.
      • isReloadActionEnabled

        public boolean isReloadActionEnabled()
        Returns true if the reload action is enabled, false otherwise.
        Returns:
        true if the reload action is enabled.
      • shouldAcceptFile

        public static boolean shouldAcceptFile​(java.io.File file)
        Whether a file chooser should accept the file as a source file.
        Parameters:
        file - the file to check.
        Returns:
        true if the file should be accepted.
      • getLastDirectory

        public java.io.File getLastDirectory()
        Get the directory of the last loaded file.
        Returns:
        directory of the last loaded file.
      • getCurrentFile

        public java.io.File getCurrentFile()
        Get current file.
        Returns:
        current file.
      • getLinesToPosition

        public java.util.List<java.lang.Integer> getLinesToPosition()
        Get lines to position map. It returns unmodifiable collection to prevent additional overhead of copying and possible state modifications.
        Returns:
        lines to position map.
      • openFile

        public void openFile​(java.io.File file)
                      throws CheckstyleException
        Open file and load the file.
        Parameters:
        file - the file to open.
        Throws:
        CheckstyleException - if the file can not be parsed.
        java.lang.IllegalArgumentException - if parseMode is unknown
      • getFileText

        private static FileText getFileText​(java.io.File file)
                                     throws java.io.IOException
        Get FileText from a file.
        Parameters:
        file - the file to get the FileText from.
        Returns:
        the FileText.
        Throws:
        java.io.IOException - if the file could not be read.