Class AbstractTerminalApplication

    • Field Detail

      • m_ApplicationTitle

        protected String m_ApplicationTitle
        the title of the application.
      • m_RemoteScriptingEngineCmdLine

        protected String m_RemoteScriptingEngineCmdLine
        the commandline of the remote scripting engine to use at startup time.
      • m_RemoteScriptingEngine

        protected RemoteScriptingEngine m_RemoteScriptingEngine
        the remote command scripting engine.
    • Constructor Detail

      • AbstractTerminalApplication

        protected AbstractTerminalApplication()
        Default constructor.
    • Method Detail

      • initTerminal

        protected abstract void initTerminal()
        Initializes the terminal.
      • logMessage

        public abstract void logMessage​(String msg)
        Logs the message.
        Parameters:
        msg - the message to log
      • logError

        public abstract void logError​(String msg)
        Logs the error.
        Parameters:
        msg - the error message to log
      • logError

        public abstract void logError​(String msg,
                                      Throwable t)
        Logs the error.
        Parameters:
        msg - the error message to log
        t - the exception
      • createLogHandler

        protected abstract Handler createLogHandler()
        Returns the log handler to use.
        Returns:
        the handler
      • finishTerminal

        protected abstract void finishTerminal()
        Finishes the initialization.
      • start

        public abstract void start()
        Starts the application.
      • stop

        public abstract void stop()
        Stops the application.
      • getDefaultApplicationTitle

        protected abstract String getDefaultApplicationTitle()
        Returns the default title of the application.
        Returns:
        the default title
      • getDefaultDatabaseConnection

        protected abstract AbstractDatabaseConnection getDefaultDatabaseConnection()
        Returns the default database connection.
        Returns:
        the default database connection
      • setRemoteScriptingEngineCmdLine

        public void setRemoteScriptingEngineCmdLine​(String value)
        Sets the commandline of the remote scripting engine to execute at startup time.
        Parameters:
        value - the commandline, use empty string if not to use one
      • getRemoteScriptingEngineCmdLine

        public String getRemoteScriptingEngineCmdLine()
        Returns the commandline of the remote scripting engine to execute at startup time.
        Returns:
        the commandline, empty string it not to use one
      • remoteScriptingEngineCmdLineTipText

        public String remoteScriptingEngineCmdLineTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • notifyRemoteScriptingEngineUpdateListeners

        public void notifyRemoteScriptingEngineUpdateListeners​(RemoteScriptingEngineUpdateEvent e)
        Notifies all listeners of remote scripting engine changes.
        Parameters:
        e - the event to send
      • getApplicationTitle

        public String getApplicationTitle()
        Returns the currently set application title.
        Returns:
        the current title
      • setApplicationTitle

        public void setApplicationTitle​(String value)
        Sets the application title to use.
        Parameters:
        value - the title to use
      • applicationTitleTipText

        public String applicationTitleTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setTitle

        protected abstract void setTitle​(String value)
        Sets the title to use.
        Parameters:
        value - the title
      • createTitle

        public void createTitle​(String title)
        creates and displays the title.
        Parameters:
        title - the additional part of the title
      • forName

        public static AbstractTerminalApplication forName​(String classname,
                                                          String[] options)
        Instantiates the application with the given options.
        Parameters:
        classname - the classname of the application to instantiate
        options - the options for the application
        Returns:
        the instantiated application or null if an error occurred
      • forCommandLine

        public static AbstractTerminalApplication forCommandLine​(String cmdline)
        Instantiates the application from the given commandline (i.e., classname and optional options).
        Parameters:
        cmdline - the classname (and optional options) of the application to instantiate
        Returns:
        the instantiated application or null if an error occurred
      • runApplication

        public static void runApplication​(Class env,
                                          Class app,
                                          String[] options)
        Runs the application from the commandline. Calling code needs to perform a System.exit(0).
        Parameters:
        env - the environment class to use
        app - the application frame class
        options - the commandline options