org.specrunner.plugins.core.flow
Class PluginPause

java.lang.Object
  extended by org.specrunner.parameters.core.ParameterHolder
      extended by org.specrunner.plugins.core.AbstractPlugin
          extended by org.specrunner.plugins.core.flow.PluginPause
All Implemented Interfaces:
IParameterHolder, IActionType, IParalelPlugin, IPlugin, ISleepPlugin, ITestPlugin, ITimedPlugin, IWaitPlugin

public class PluginPause
extends AbstractPlugin

Allows a pause in execution, waiting for an 'OK' in dialog, or 'Enter' when 'enter'attribute is set to true.

Author:
Thiago Santos

Field Summary
static Boolean DEFAULT_MODAL
          Modal default value.
protected  Boolean enter
          Pause using a keyboard request.
static String FEATURE_ENTER
          Enter feature.
static String FEATURE_MODAL
          Modal feature.
static String FEATURE_PAUSE_CONDITION
          Condition.
static String FEATURE_PAUSE_CONDITION_MODEL
          Model condition.
static String FEATURE_TIME
          Time feature.
protected static int FONT_SIZE
          Screen font size.
protected  Boolean modal
          Modal flag.
protected  String msg
          Pause message.
protected static int RATIO
          Message frame screen ratio.
protected  Long time
          Pause time.
 
Fields inherited from class org.specrunner.plugins.core.AbstractPlugin
FEATURE_CONDITION, FEATURE_NORMALIZED, FEATURE_NORMALIZER, FEATURE_SLEEP, FEATURE_THREADSAFE, FEATURE_TIMEOUT, FEATURE_WAIT
 
Fields inherited from class org.specrunner.parameters.core.ParameterHolder
parameters
 
Constructor Summary
PluginPause()
           
 
Method Summary
 ENext doStart(IContext context, IResultSet result)
          Performs the start action. i.e. create a database schema.
 ActionType getActionType()
          Get the plugin type.
 Boolean getEnter()
          Flag to indicate if pause is on dialog or 'Enter' key.
 Boolean getModal()
          Get modal information.
 String getMsg()
          Get pause message.
 String getPause()
          Get pause message.
 Long getTime()
          If set, specify the time to wait.
 void initialize(IContext context)
          Initialize the plugin.
protected  void releaseWindow(JFrame frame, JDialog dialog)
          Release message frame and dialog.
 void setEnter(Boolean enter)
          Set enter flag.
 void setModal(Boolean modal)
          Set modal flag.
 void setMsg(String msg)
          Set pause message.
 void setPause(String msg)
          Set pause message.
 void setTime(Long time)
          Sets the wait time.
protected  void showMessage(String message)
          Show a message on a dialog.
 
Methods inherited from class org.specrunner.plugins.core.AbstractPlugin
copy, doEnd, getCondition, getConditionModel, getNormalized, getNormalized, getNormalizer, getParent, getSleep, getSleepModel, getThreadsafe, getTimeout, getTimeoutModel, getWait, getWaitModel, setCondition, setConditionModel, setNormalized, setNormalizer, setParent, setSleep, setSleepModel, setThreadsafe, setTimeout, setTimeoutModel, setWait, setWaitModel, toString
 
Methods inherited from class org.specrunner.parameters.core.ParameterHolder
getParameters, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.specrunner.parameters.IParameterHolder
getParameters, setParameters
 

Field Detail

FEATURE_PAUSE_CONDITION

public static final String FEATURE_PAUSE_CONDITION
Condition.


FEATURE_PAUSE_CONDITION_MODEL

public static final String FEATURE_PAUSE_CONDITION_MODEL
Model condition.


FEATURE_ENTER

public static final String FEATURE_ENTER
Enter feature.


FEATURE_TIME

public static final String FEATURE_TIME
Time feature.


FEATURE_MODAL

public static final String FEATURE_MODAL
Modal feature.


DEFAULT_MODAL

public static final Boolean DEFAULT_MODAL
Modal default value.


RATIO

protected static final int RATIO
Message frame screen ratio.

See Also:
Constant Field Values

FONT_SIZE

protected static final int FONT_SIZE
Screen font size.

See Also:
Constant Field Values

msg

protected String msg
Pause message.


enter

protected Boolean enter
Pause using a keyboard request.


time

protected Long time
Pause time.


modal

protected Boolean modal
Modal flag.

Constructor Detail

PluginPause

public PluginPause()
Method Detail

getMsg

public String getMsg()
Get pause message.

Returns:
The message.

setMsg

public void setMsg(String msg)
Set pause message.

Parameters:
msg - Set pause message.

getPause

public String getPause()
Get pause message.

Returns:
The message.

setPause

public void setPause(String msg)
Set pause message.

Parameters:
msg - Set pause message.

getEnter

public Boolean getEnter()
Flag to indicate if pause is on dialog or 'Enter' key. Default is false.

Returns:
true, if pause halt on 'Enter', false, otherwise.

setEnter

public void setEnter(Boolean enter)
Set enter flag.

Parameters:
enter - true to request for 'Enter', false, otherwise (default is a dialog request).

getTime

public Long getTime()
If set, specify the time to wait. Otherwise, press any key to move on.

Returns:
The time to wait.

setTime

public void setTime(Long time)
Sets the wait time.

Parameters:
time - The time.

getModal

public Boolean getModal()
Get modal information.

Returns:
true, if modal, false, otherwise.

setModal

public void setModal(Boolean modal)
Set modal flag.

Parameters:
modal - Modal mode.

getActionType

public ActionType getActionType()
Description copied from interface: IActionType
Get the plugin type.

Returns:
The type.

initialize

public void initialize(IContext context)
                throws PluginException
Description copied from interface: IPlugin
Initialize the plugin. Performed after set parameters.

Specified by:
initialize in interface IPlugin
Overrides:
initialize in class AbstractPlugin
Parameters:
context - The test context.
Throws:
PluginException - On initialization errors.

doStart

public ENext doStart(IContext context,
                     IResultSet result)
              throws PluginException
Description copied from interface: IPlugin
Performs the start action. i.e. create a database schema. Performed after initialization.

Specified by:
doStart in interface IPlugin
Overrides:
doStart in class AbstractPlugin
Parameters:
context - The context.
result - The result set.
Returns:
SKIP, to skip node, DEEP, to go deep into the node.
Throws:
PluginException - On execution errors.

showMessage

protected void showMessage(String message)
Show a message on a dialog.

Parameters:
message - A message.

releaseWindow

protected void releaseWindow(JFrame frame,
                             JDialog dialog)
Release message frame and dialog.

Parameters:
frame - The frame.
dialog - The dialog.


Copyright © 2015. All rights reserved.