Class BasicSessionControl

    • Field Detail

      • testSuite

        protected final TestSuite testSuite
      • parent

        protected javax.swing.JComponent parent
      • sessionView

        protected javax.swing.JPanel sessionView
    • Constructor Detail

    • Method Detail

      • getSession

        public Session getSession()
        Returns the session object under control
        Specified by:
        getSession in interface ET_SessionControl
        Returns:
        The session associated with this instance.
      • getViewComponent

        public javax.swing.JComponent getViewComponent()
        Returns the panel reflecting the current state of the session
        Specified by:
        getViewComponent in interface ET_SessionControl
      • getToolBarActionList

        public java.util.List<javax.swing.Action> getToolBarActionList()
        Description copied from interface: ET_Control
        Returns list of actions to be added to the tool bar
        Specified by:
        getToolBarActionList in interface ET_Control
      • save

        public void save​(java.util.Map m)
        Description copied from interface: ET_Control
        Saves current state to the map
        Specified by:
        save in interface ET_Control
      • restore

        public void restore​(java.util.Map m)
        Description copied from interface: ET_Control
        Restores saved state from the map
        Specified by:
        restore in interface ET_Control
      • createEmptySession

        protected SessionExt createEmptySession()
                                         throws Session.Fault
        Creates an empty configuration for the test suite. By default BasicSession is used. It's supposed for subclasses to override this method.
        Returns:
        created session.
        Throws:
        Session.Fault
      • clone

        public static Parameters clone​(Parameters p)
                                throws Session.Fault
        Clones passed parameters. Works only for InterviewParameters instances.
        Parameters:
        p - instance to clone, might be null.
        Returns:
        cloned object obtained for the passed one by performing save/load operations.
        Throws:
        Session.Fault
      • ensureInterviewUpToDate

        public void ensureInterviewUpToDate()
      • startTests

        public void startTests​(Parameters p)
        Invoked when runTestHandler is going to start test execution
        Specified by:
        startTests in interface com.sun.javatest.exec.ET_RunTestControl.Observer
      • finishTests

        public void finishTests​(Parameters p)
        Invoked when runTestHandler completed test execution
        Specified by:
        finishTests in interface com.sun.javatest.exec.ET_RunTestControl.Observer
      • whatToDoWhenConfigNotReadyButUserPressedStartButton

        public void whatToDoWhenConfigNotReadyButUserPressedStartButton​(javax.swing.Action startAction)
      • checkExcludeListUpdate

        protected void checkExcludeListUpdate​(javax.swing.JComponent parent,
                                              boolean quietIfNoUpdate,
                                              Parameters params)
      • getNeedToAutoCheckExcludeList

        protected boolean getNeedToAutoCheckExcludeList​(Parameters params)
      • getMenu

        public javax.swing.JMenu getMenu()
        Description copied from interface: ET_Control
        Returts menu to be added to the menu mar
        Specified by:
        getMenu in interface ET_Control
      • initEditor

        protected boolean initEditor()
        Initializes interviewEditor.
        Returns:
        true if initialized successfully, false if failed.
      • createInterviewEditor

        protected InterviewEditor createInterviewEditor​(InterviewParameters ip)
        Creates an InterviewEditor instance. Subclasses might override this method to create an alternative editor.
        Parameters:
        ip - parameters to be edited
      • getUIFactory

        protected UIFactory getUIFactory()
        Method returning UIFactory to be used to create InterviewEditor instance.
      • edit

        public void edit()
        Causes configuration editor to appear. If workdir is not set, suggests to create one first.
        Specified by:
        edit in interface ET_SessionControl
      • configure

        public void configure()
        Causes a series of actions to be performed to complete configuration:
        If session is already ready - does nothing.
        If work directory is not set - suggests creating or opening one
        Opens configuration editor.
        Specified by:
        configure in interface ET_SessionControl
      • isConfiguring

        public boolean isConfiguring()
        Specified by:
        isConfiguring in interface ET_SessionControl
        Returns:
        true if configure() method is running or configuration is editing.
      • showWorkDirDialog

        protected void showWorkDirDialog()
      • showConfigureDialog

        protected void showConfigureDialog()
      • initActions

        protected void initActions()
      • createNewWorkDirAction

        protected ToolAction createNewWorkDirAction()
      • createSetWorkDirAction

        protected ToolAction createSetWorkDirAction()
      • initHistoryListeners

        protected void initHistoryListeners()
      • createSessionView

        protected javax.swing.JPanel createSessionView()
      • updateGUI

        public void updateGUI()
        Description copied from interface: ET_Control
        Invoked when some change has happened
        Specified by:
        updateGUI in interface ET_Control
      • isEditorVisible

        protected boolean isEditorVisible()
        Returns:
        true if user has an interview editor open.
      • changedVisibility

        public void changedVisibility​(boolean isVisible,
                                      InterviewEditor editor)
        InterviewEditor.Observer method. Invoked when InterviewEditor is made either visible or invisible. Implementations call updateGUI() to enable/disable actions.
        Specified by:
        changedVisibility in interface InterviewEditor.Observer
        Parameters:
        isVisible - - true or false
        editor - editor that changed the state
      • createWD

        protected boolean createWD()
        Causes the dialog for new directory creating to appear. Invoked from createNewWorkDirAction. Subclasses might override this method to perform extra actions associated with creating new work directory, like setting template.
        Returns:
        true if configuration editing is required after WorkDir created
      • setWD

        protected boolean setWD()
        Causes the dialog for work directory selecting to appear. Invoked from createSetWorkDirAction. Subclasses might override this method to perform extra actions associated with setting work directory, like setting template.
        Returns:
        true if configuration editing is required after WorkDir set
      • applyWorkDir

        protected void applyWorkDir​(WorkDirectory wd)
        Applies value of the selected work directory.
        Parameters:
        wd -
      • restoreConfigFromWD

        public void restoreConfigFromWD​(WorkDirectory wd)
                                 throws Session.Fault
        Tries to restore latest available configuration for the session.
        Parameters:
        wd -
        Throws:
        Session.Fault