Class MainFrameModel


  • public class MainFrameModel
    extends Object
    Model for checkstyle frame.
    Author:
    Vladislav Lisetskiy
    • Constructor Detail

    • Method Detail

      • getText

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

        public 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​(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 File getLastDirectory()
        Get the directory of the last loaded file.
        Returns:
        directory of the last loaded file.
      • parseFile

        public DetailAST parseFile​(File file)
                            throws IOException,
                                   antlr.ANTLRException
        Parse a file and return the parse tree.
        Parameters:
        file - the file to parse.
        Returns:
        the root node of the parse tree.
        Throws:
        IOException - if the file could not be read.
        antlr.ANTLRException - if the file is not a Java source.
      • parseFileWithComments

        public DetailAST parseFileWithComments​(File file)
                                        throws IOException,
                                               antlr.ANTLRException
        Parse a file and return the parse tree with comment nodes.
        Parameters:
        file - the file to parse.
        Returns:
        the root node of the parse tree.
        Throws:
        IOException - if the file could not be read.
        antlr.ANTLRException - if the file is not a Java source.
      • getFileText

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