Class FileMonitorPanel

    • Field Detail

      • m_TitleGenerator

        protected TitleGenerator m_TitleGenerator
        for generating the title.
      • m_CurrentFile

        protected File m_CurrentFile
        the filename of the current file.
      • m_FileChooser

        protected BaseFileChooser m_FileChooser
        the filedialog for loading files.
      • m_MenuBar

        protected JMenuBar m_MenuBar
        the menu bar, if used.
      • m_MenuItemOpen

        protected JMenuItem m_MenuItemOpen
        the "open" submenu.
      • m_MenuItemOpenRecent

        protected JMenu m_MenuItemOpenRecent
        the "open recent" submenu.
      • m_MenuItemClose

        protected JMenuItem m_MenuItemClose
        the "close" submenu.
      • m_TextMonitor

        protected BaseTextArea m_TextMonitor
        for displaying the content.
      • m_Tailer

        protected transient org.apache.commons.io.input.Tailer m_Tailer
        the tailer instance.
    • Constructor Detail

      • FileMonitorPanel

        public FileMonitorPanel()
    • 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
      • getMenuBar

        public JMenuBar getMenuBar()
        Creates a menu bar (singleton per panel object). Can be used in frames.
        Specified by:
        getMenuBar in interface MenuBarProvider
        Returns:
        the menu bar
      • open

        protected void open()
        Prompts the user to select a file to monitor.
      • open

        protected void open​(File file)
        Monitors the specified file.
        Parameters:
        file - the file to monitor
      • close

        protected void close()
        Closes the dialog or frame.
      • updateMenu

        protected void updateMenu()
        Updates the state of the menu items.
      • addLine

        public void addLine​(String line)
        Appends the line from the file.
        Parameters:
        line - the line to append
      • getTitleGenerator

        public TitleGenerator getTitleGenerator()
        Returns the title generator in use.
        Returns:
        the generator
      • updateTitle

        protected void updateTitle()
        Updates the title of the dialog.
      • setCurrentFile

        protected void setCurrentFile​(File value)
        Sets the current file.
        Parameters:
        value - the file
      • getCurrentFile

        public File getCurrentFile()
        Returns the current file in use.
        Returns:
        the current file, can be null
      • stopListening

        protected void stopListening()
        Stops the file tailer.
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.
        Specified by:
        cleanUp in interface CleanUpHandler