com.rational.test.ft.services

Class Monitor

  • java.lang.Object
    • java.awt.Component
      • java.awt.Container
        • java.awt.Window
          • java.awt.Frame
            • javax.swing.JFrame
              • com.rational.test.ft.services.Monitor
  • All Implemented Interfaces:
    com.rational.test.ft.recorder.IRecord, com.rational.test.ft.recorder.IRecordListener, IMonitor, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants


    public class Monitor
    extends javax.swing.JFrame
    implements IMonitor, com.rational.test.ft.recorder.IRecord, com.rational.test.ft.recorder.IRecordListener
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      class  Monitor.LocalChangeListener 
      class  Monitor.MainWindowComponentListener 
      class  Monitor.ReportErrorThread 
      class  Monitor.SymComponent 
      class  Monitor.SymWindow 
      • Nested classes/interfaces inherited from class javax.swing.JFrame

        javax.swing.JFrame.AccessibleJFrame
      • Nested classes/interfaces inherited from class java.awt.Frame

        java.awt.Frame.AccessibleAWTFrame
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Constructor Summary

      Constructors 
      Constructor and Description
      Monitor() 
      Monitor(boolean monitorVisible, com.rational.test.ft.recorder.Recorder recorder, java.lang.String language, com.ibm.rational.test.ft.tools.interfaces.ICommandLineParams cliParam) 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void abort()
      Abort recording immediately, performing minimal cleanup and exit processing.
      protected void addMonitorButtons(javax.swing.JToolBar toolbar) 
      void addMonitorListener(IMonitorListener listener)
      Add a monitor action listener.
      void addNotify() 
      void addRecordListener(com.rational.test.ft.recorder.IRecordListener listener)
      Add a record action listener to this recorder.
      void addShowHelpOnStartupText() 
      protected void addStylesToDocument(javax.swing.text.StyledDocument doc) 
      protected com.rational.test.ft.ui.jfc.ToolbarButton createButton(java.lang.String name)
      Create a button
      java.awt.Dimension getMinimumSize() 
      static IMonitor getMonitor()
      Return the monitor
      boolean hideRecordMonitor() 
      protected void initFromPreferences()
      Initialize from the display preferences
      protected javax.swing.text.SimpleAttributeSet[] initTextColors() 
      boolean isPaused()
      This method returns true if recording has been paused.
      boolean isStopped()
      This method returns true if recording has been terminated.
      void pause()
      This method is called when the recording session is paused.
      void println(int msgKind, java.lang.String message)
      Print the specified message.
      void println(int msgKind, java.lang.String msg, java.lang.Object arg0)
      This method outputs a message with one parameter substitution in the message pattern.
      void println(int msgKind, java.lang.String msg, java.lang.Object[] args)
      This method outputs a message with some number of parameter substitutions in the message pattern.
      void println(int msgKind, java.lang.String msg, java.lang.Object arg0, java.lang.Object arg1)
      This method outputs a message with two parameter substitutions in the message pattern.
      void println(int msgKind, java.lang.String msg, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2)
      This method outputs a message with three parameter substitutions in the message pattern.
      void println(int msgKind, java.lang.String msg, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
      This method outputs a message with four parameter substitutions in the message pattern.
      void println(int msgKind, java.lang.String msg, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
      This method outputs a message with five parameter substitutions in the message pattern.
      void removeMonitorListener(IMonitorListener listener)
      Remove a monitor action listener.
      void removeRecordListener(com.rational.test.ft.recorder.IRecordListener listener)
      Remove a record action listener to this recorder.
      void reportError(java.lang.Object errMsg, java.lang.Object[] details, boolean wait)
      Pause the recording session and display an error message in both the monitor and in an error dialog.
      void resume()
      This method is called when the recording session is resumed.
      protected void setCopyButtonState(javax.swing.event.CaretEvent e) 
      void setMonitorState(int currentState)
      To set the busy flag for the monitor.
      void setMonitorVisible(boolean state)
      Display the RecordMonitor and not the RecordToolbar, or vice versa
      void setPauseState(boolean displayPaused)
      The pause button was pressed in the floating record toolbar.
      void setVisible(boolean state) 
      void showRecordMonitor(boolean showMonitor) 
      void start(com.ibm.rational.test.ft.tools.interfaces.ICommandLineParams cliParams)
      Start recording to a specified script with the expressed attributes.
      void start(java.lang.String script, java.lang.String project)
      This method is called when the recording session is started.
      void stop()
      This method is called when record processing is stopped.
      • Methods inherited from class javax.swing.JFrame

        addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Frame

        getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, show, toBack, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.awt.MenuContainer

        getFont, postEvent
    • Field Detail

      • instance

        protected static Monitor instance
      • DOCK_TOOLBAR

        public static java.lang.String DOCK_TOOLBAR
      • COPY

        public static java.lang.String COPY
      • SAVEAS

        public static java.lang.String SAVEAS
      • CLEAR

        public static java.lang.String CLEAR
      • MESSAGE_OPTIONS

        public static java.lang.String MESSAGE_OPTIONS
      • debug

        protected static com.rational.test.ft.util.FtDebug debug
      • monitorVisible

        protected boolean monitorVisible
      • recordToolbar

        protected com.rational.test.ft.recorder.jfc.Toolbar recordToolbar
      • inConstructor

        protected boolean inConstructor
      • forcedResize

        protected boolean forcedResize
      • textAttrs

        protected javax.swing.text.SimpleAttributeSet[] textAttrs
      • toolbarPanel

        protected javax.swing.JPanel toolbarPanel
      • monitorToolbar

        protected javax.swing.JToolBar monitorToolbar
      • textPane

        protected javax.swing.JScrollPane textPane
      • monitorText

        protected javax.swing.JTextPane monitorText
      • monitorStatusText

        protected javax.swing.JTextField monitorStatusText
    • Constructor Detail

      • Monitor

        public Monitor()
      • Monitor

        public Monitor(boolean monitorVisible,
                       com.rational.test.ft.recorder.Recorder recorder,
                       java.lang.String language,
                       com.ibm.rational.test.ft.tools.interfaces.ICommandLineParams cliParam)
    • Method Detail

      • getMonitor

        public static IMonitor getMonitor()
        Return the monitor
        Returns:
        The monitor instance
      • addStylesToDocument

        protected void addStylesToDocument(javax.swing.text.StyledDocument doc)
      • addShowHelpOnStartupText

        public void addShowHelpOnStartupText()
      • setVisible

        public void setVisible(boolean state)
        Overrides:
        setVisible in class java.awt.Window
      • showRecordMonitor

        public void showRecordMonitor(boolean showMonitor)
      • hideRecordMonitor

        public boolean hideRecordMonitor()
      • addNotify

        public void addNotify()
        Overrides:
        addNotify in class java.awt.Frame
      • getMinimumSize

        public java.awt.Dimension getMinimumSize()
        Overrides:
        getMinimumSize in class java.awt.Container
      • setMonitorVisible

        public void setMonitorVisible(boolean state)
        Display the RecordMonitor and not the RecordToolbar, or vice versa
      • addMonitorButtons

        protected void addMonitorButtons(javax.swing.JToolBar toolbar)
      • createButton

        protected com.rational.test.ft.ui.jfc.ToolbarButton createButton(java.lang.String name)
        Create a button
        Parameters:
        name - The button's name
      • initFromPreferences

        protected void initFromPreferences()
        Initialize from the display preferences
      • setCopyButtonState

        protected void setCopyButtonState(javax.swing.event.CaretEvent e)
      • initTextColors

        protected javax.swing.text.SimpleAttributeSet[] initTextColors()
      • println

        public void println(int msgKind,
                            java.lang.String message)
        Print the specified message.
        Specified by:
        println in interface IMonitor
        Parameters:
        msgKind - The type of
      • println

        public void println(int msgKind,
                            java.lang.String msg,
                            java.lang.Object[] args)
        This method outputs a message with some number of parameter substitutions in the message pattern.
        Specified by:
        println in interface IMonitor
        Parameters:
        msgKind - The type of
        msg - The message
        args - The arguments used to resolve substitution sequences the message pattern
      • println

        public void println(int msgKind,
                            java.lang.String msg,
                            java.lang.Object arg0)
        This method outputs a message with one parameter substitution in the message pattern.
        Specified by:
        println in interface IMonitor
        Parameters:
        msgKind - The type of
        msg - The message
        arg0 - The zero argument used to resolve parameter substitution in the message pattern
      • println

        public void println(int msgKind,
                            java.lang.String msg,
                            java.lang.Object arg0,
                            java.lang.Object arg1)
        This method outputs a message with two parameter substitutions in the message pattern.
        Specified by:
        println in interface IMonitor
        Parameters:
        msgKind - The type of
        msg - The message
        arg0 - The zero argument used to resolve parameter substitution in the message pattern
        arg1 - The one argument used to resolve parameter substitution in the message pattern
      • println

        public void println(int msgKind,
                            java.lang.String msg,
                            java.lang.Object arg0,
                            java.lang.Object arg1,
                            java.lang.Object arg2)
        This method outputs a message with three parameter substitutions in the message pattern.
        Specified by:
        println in interface IMonitor
        Parameters:
        msgKind - The type of
        msg - The message
        arg0 - The zero argument used to resolve parameter substitution in the message pattern
        arg1 - The one argument used to resolve parameter substitution in the message pattern
        arg2 - The two argument used to resolve parameter substitution in the message pattern
      • println

        public void println(int msgKind,
                            java.lang.String msg,
                            java.lang.Object arg0,
                            java.lang.Object arg1,
                            java.lang.Object arg2,
                            java.lang.Object arg3)
        This method outputs a message with four parameter substitutions in the message pattern.
        Specified by:
        println in interface IMonitor
        Parameters:
        msgKind - The type of
        msg - The message
        arg0 - The zero argument used to resolve parameter substitution in the message pattern
        arg1 - The one argument used to resolve parameter substitution in the message pattern
        arg2 - The two argument used to resolve parameter substitution in the message pattern
        arg3 - The three argument used to resolve parameter substitution in the message pattern
      • println

        public void println(int msgKind,
                            java.lang.String msg,
                            java.lang.Object arg0,
                            java.lang.Object arg1,
                            java.lang.Object arg2,
                            java.lang.Object arg3,
                            java.lang.Object arg4)
        This method outputs a message with five parameter substitutions in the message pattern.
        Specified by:
        println in interface IMonitor
        Parameters:
        msgKind - The type of
        msg - The message
        arg0 - The zero argument used to resolve parameter substitution in the message pattern
        arg1 - The one argument used to resolve parameter substitution in the message pattern
        arg2 - The two argument used to resolve parameter substitution in the message pattern
        arg3 - The three argument used to resolve parameter substitution in the message pattern
        arg4 - The four argument used to resolve parameter substitution in the message pattern
      • reportError

        public void reportError(java.lang.Object errMsg,
                                java.lang.Object[] details,
                                boolean wait)
        Pause the recording session and display an error message in both the monitor and in an error dialog.

        This should only be used for severe errors in which the record session has been compromised.

        Specified by:
        reportError in interface IMonitor
        Parameters:
        errMsg - Error message
        details - Detailed error information.<\br> If null, there are no details
        wait - Whether to wait for the message dialog to close before returning
        See Also:
        com.rational.test.ft.ui.jfc.MessageDoalog#show(Object[],String,int,int,String,boolean)
      • start

        public void start(java.lang.String script,
                          java.lang.String project)
        This method is called when the recording session is started.
        Specified by:
        start in interface com.rational.test.ft.recorder.IRecordListener
      • stop

        public void stop()
        This method is called when record processing is stopped.
        Specified by:
        stop in interface com.rational.test.ft.recorder.IRecordListener
      • pause

        public void pause()
        This method is called when the recording session is paused.
        Specified by:
        pause in interface com.rational.test.ft.recorder.IRecordListener
      • resume

        public void resume()
        This method is called when the recording session is resumed.
        Specified by:
        resume in interface com.rational.test.ft.recorder.IRecordListener
      • addMonitorListener

        public void addMonitorListener(IMonitorListener listener)
        Add a monitor action listener.
      • removeMonitorListener

        public void removeMonitorListener(IMonitorListener listener)
        Remove a monitor action listener. If the listener was not previously added this method has no effect.
      • setMonitorState

        public void setMonitorState(int currentState)
        Description copied from interface: IMonitor
        To set the busy flag for the monitor.
        Specified by:
        setMonitorState in interface IMonitor
      • start

        public void start(com.ibm.rational.test.ft.tools.interfaces.ICommandLineParams cliParams)
                   throws RationalTestException
        Start recording to a specified script with the expressed attributes. This method returns immediately after starting recording informing listeners of the record status. Record status can be polled at any time using the isStopped or isPaused methods.
        Specified by:
        start in interface com.rational.test.ft.recorder.IRecord
        Throws:
        RationalTestException - Thrown if an invalid file specification is passed.
        Parameters:
        script - The full Java name of the script to be generated. This name is case-sensitive and includes an optional package name. The package name is utilised as an implied directory structure for script persistence.
        project - The filesystem directory the script file should be stored relative to. The package directory structure is implied in the script parameter.
        insertBefore - The line number before which new code will be inserted. This value is less then zero if a placeholder marker should be used instead.
        isNotModel - Specifies if the recording is being done on a simplified script or not. If false, the recording is a simplified script, if true, recording is not simplified.
      • abort

        public void abort()
        Abort recording immediately, performing minimal cleanup and exit processing.
        Specified by:
        abort in interface com.rational.test.ft.recorder.IRecord
      • isStopped

        public boolean isStopped()
        This method returns true if recording has been terminated.
        Specified by:
        isStopped in interface com.rational.test.ft.recorder.IRecord
      • isPaused

        public boolean isPaused()
        This method returns true if recording has been paused.
        Specified by:
        isPaused in interface com.rational.test.ft.recorder.IRecord
      • addRecordListener

        public void addRecordListener(com.rational.test.ft.recorder.IRecordListener listener)
        Add a record action listener to this recorder.
        Specified by:
        addRecordListener in interface com.rational.test.ft.recorder.IRecord
      • removeRecordListener

        public void removeRecordListener(com.rational.test.ft.recorder.IRecordListener listener)
        Remove a record action listener to this recorder. If the listener was not previously added this method has no effect.
        Specified by:
        removeRecordListener in interface com.rational.test.ft.recorder.IRecord
      • setPauseState

        public void setPauseState(boolean displayPaused)
        The pause button was pressed in the floating record toolbar. Update the record toolbar in the monitor to reflect the correct state.