Class AbstractScriptingDialog

    • Field Detail

      • m_TitleGenerator

        protected TitleGenerator m_TitleGenerator
        for generating the title.
      • m_FileChooser

        protected BaseFileChooser m_FileChooser
        for loading/saving the scripts.
      • m_Menu

        protected JMenuBar m_Menu
        the menu.
      • m_MenuItemFileNew

        protected JMenuItem m_MenuItemFileNew
        the new menu item.
      • m_MenuItemFileLoad

        protected JMenuItem m_MenuItemFileLoad
        the load menu item.
      • m_MenuItemFileLoadRecent

        protected JMenu m_MenuItemFileLoadRecent
        the load recent submenu.
      • m_MenuItemFileSave

        protected JMenuItem m_MenuItemFileSave
        the save menu item.
      • m_MenuItemFileSaveAs

        protected JMenuItem m_MenuItemFileSaveAs
        the save as menu item.
      • m_MenuItemFilePrint

        protected JMenuItem m_MenuItemFilePrint
        the print menu item.
      • m_MenuItemFileClose

        protected JMenuItem m_MenuItemFileClose
        the close menu item.
      • m_MenuItemEditUndo

        protected JMenuItem m_MenuItemEditUndo
        the undo menu item.
      • m_MenuItemEditRedo

        protected JMenuItem m_MenuItemEditRedo
        the redo menu item.
      • m_MenuItemEditClear

        protected JMenuItem m_MenuItemEditClear
        the clear menu item.
      • m_MenuItemEditAppendRecorded

        protected JMenuItem m_MenuItemEditAppendRecorded
        the append recorded menu item.
      • m_MenuItemScriptStart

        protected JMenuItem m_MenuItemScriptStart
        the execute menu item.
      • m_MenuItemScriptStop

        protected JMenuItem m_MenuItemScriptStop
        the stop menu item.
      • m_MenuItemViewWordWrap

        protected JMenuItem m_MenuItemViewWordWrap
        the line wrap menu item.
      • m_MenuItemHelp

        protected JMenuItem m_MenuItemHelp
        the help menu item.
      • m_CurrentFile

        protected File m_CurrentFile
        the currently loaded file.
      • m_Modified

        protected boolean m_Modified
        whether the current content was modified.
      • m_Properties

        protected Properties m_Properties
        the properties for scripting.
      • m_Undo

        protected UndoManager m_Undo
        the undo manager for the text pane.
      • m_BasePanel

        protected BasePanel m_BasePanel
        the base panel this dialog should operate on.
      • m_FilenameProposer

        protected FilenameProposer m_FilenameProposer
        for proposing filenames for new flows.
    • Constructor Detail

      • AbstractScriptingDialog

        public AbstractScriptingDialog​(Dialog owner,
                                       BasePanel panel)
        Creates a non-modal dialog.
        Parameters:
        owner - the owning dialog
        panel - the base panel this dialog belongs to
      • AbstractScriptingDialog

        public AbstractScriptingDialog​(Frame owner,
                                       BasePanel panel)
        Creates a non-modal dialog.
        Parameters:
        owner - the owning frame
        panel - the base panel this dialog belongs to
    • Method Detail

      • initialize

        protected void initialize()
        initializes member variables.
        Overrides:
        initialize in class BaseDialog
      • getDefaultDatabaseConnection

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

        protected void initGUI()
        Initializes the GUI.
        Overrides:
        initGUI in class BaseDialog
      • getBasePanel

        public BasePanel getBasePanel()
        Returns the underlying base panel.
        Returns:
        the panel
      • setWordWrap

        protected void setWordWrap​(boolean wrap)
        toggles the wordwrap.
        Parameters:
        wrap - whether to wrap or not
      • getWordWrap

        public boolean getWordWrap()
        Returns the wordwrap status.
        Returns:
        true if wordwrap is on
      • checkForModified

        protected boolean checkForModified()
        Returns whether we can proceed with the operation or not, depending on whether the user saved the script or discarded the changes.
        Returns:
        true if safe to proceed
      • newScript

        protected void newScript()
        Starts a new script.
      • load

        protected void load()
        loads a script from a file.
      • load

        protected boolean load​(File file,
                               boolean errorDlg)
        Loads the specified file from disk, optionally shows an error dialog if an error is encountered. If successful the current filename is set to the one given here.
        Parameters:
        file - the file to load
        errorDlg - if true and an error is encountered an error dialog is displayed
        Returns:
        true if successfully loaded.
        See Also:
        m_CurrentFile
      • save

        protected void save()
        saves the current script to a file.
      • saveAs

        protected void saveAs()
        saves the current script to a file.
      • save

        protected boolean save​(File file,
                               boolean errorDlg)
        Saves the current content to the specified file. Sets the current file to the one given here.
        Parameters:
        file - the file to save the content to
        errorDlg - if true shows an error dialog in case of an error
        Returns:
        true if saving was successful
        See Also:
        m_CurrentFile
      • close

        protected void close()
        Closes the dialog.
      • help

        protected void help()
        Displays a help dialog.
      • startExecution

        protected void startExecution()
        executes the currently loaded script.
      • stopExecution

        protected void stopExecution()
        stops the currently running script.
      • appendRecorded

        protected void appendRecorded()
        appends the recorded commands.
      • clear

        protected void clear()
        clears the input.
      • updateMenu

        protected void updateMenu()
        updates the state of the menu.
      • getTitleGenerator

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

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

        protected String getSessionFile()
        Returns the name of the session file to use.
        Returns:
        the filename (no path)
      • cleanUp

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