IBM Rational Functional Tester
Version 8.2.1
IBM Rational Functional Tester API Reference

Project Version 2.3

com.rational.test.ft.services
Class Monitor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by com.rational.test.ft.services.Monitor
All Implemented Interfaces:
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

See Also:
Serialized Form

Nested Class Summary
 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
 
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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String CLEAR
           
static java.lang.String COPY
           
protected static FtDebug debug
           
static java.lang.String DOCK_TOOLBAR
           
protected  boolean forcedResize
           
protected  Monitor frame
           
protected  boolean inConstructor
           
protected static Monitor instance
           
static java.lang.String MESSAGE_OPTIONS
           
protected  javax.swing.JTextField monitorStatusText
           
protected  MonitorStyledDocument monitorStyledDocument
           
protected  javax.swing.JTextPane monitorText
           
protected  javax.swing.JToolBar monitorToolbar
           
protected  boolean monitorVisible
           
protected  Toolbar recordToolbar
           
static java.lang.String SAVEAS
           
protected  javax.swing.text.SimpleAttributeSet[] textAttrs
           
protected  javax.swing.JScrollPane textPane
           
protected  javax.swing.JPanel toolbarPanel
           
protected static MonitorUIPreferences uiPreferences
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.rational.test.ft.services.IMonitor
CLEAR_STATE, ERROR_MSG, INFO_MSG, PAUSE_STATE, PROCESSING_STATE, READY_STATE, RQM_CONN_LOST_STATE, RQM_CONN_RESTORE_STATE, STOP_STATE, WARNING_MSG
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Monitor()
           
Monitor(boolean monitorVisible, Recorder recorder, java.lang.String language, ICommandLineParams cliParam)
           
 
Method Summary
 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(IRecordListener listener)
          Add a record action listener to this recorder.
 void addShowHelpOnStartupText()
           
protected  void addStylesToDocument(javax.swing.text.StyledDocument doc)
           
protected  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(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(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, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, 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, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, 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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, 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, isOpaque, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, 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

uiPreferences

protected static MonitorUIPreferences uiPreferences

debug

protected static FtDebug debug

monitorVisible

protected boolean monitorVisible

recordToolbar

protected Toolbar recordToolbar

inConstructor

protected boolean inConstructor

forcedResize

protected boolean forcedResize

monitorStyledDocument

protected MonitorStyledDocument monitorStyledDocument

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

frame

protected Monitor frame
Constructor Detail

Monitor

public Monitor()

Monitor

public Monitor(boolean monitorVisible,
               Recorder recorder,
               java.lang.String language,
               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.Component

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 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.


stop

public void stop()
This method is called when record processing is stopped.


pause

public void pause()
This method is called when the recording session is paused.


resume

public void resume()
This method is called when the recording session is resumed.


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(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.

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.


isStopped

public boolean isStopped()
This method returns true if recording has been terminated.


isPaused

public boolean isPaused()
This method returns true if recording has been paused.


addRecordListener

public void addRecordListener(IRecordListener listener)
Add a record action listener to this recorder.


removeRecordListener

public void removeRecordListener(IRecordListener listener)
Remove a record action listener to this recorder. If the listener was not previously added this method has no effect.


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.