org.specrunner.listeners.core
Class PauseOnFailureNodeListener

java.lang.Object
  extended by org.specrunner.listeners.core.AbstractNodeListener
      extended by org.specrunner.listeners.core.PauseOnFailureNodeListener
All Implemented Interfaces:
ErrorFrameListener, INodeListener, ISpecRunnerListener

public class PauseOnFailureNodeListener
extends AbstractNodeListener
implements ErrorFrameListener

Listener to pause execution on errors.

Author:
Thiago Santos.

Field Summary
static String FEATURE_CONDITION
          Default conditional feature.
static String FEATURE_PAUSE_ON_FAILURE
          Enable pause on errors.
static String FEATURE_SHOW_DIALOG
          Enable error dialog on failures.
 
Constructor Summary
PauseOnFailureNodeListener()
           
 
Method Summary
 Boolean getCondition()
          Condition to enable pause on failure behavior.
 String getName()
          The listener name.
 Boolean getPauseOnFailure()
          The pause status.
 Boolean getShowDialog()
          The dialog enabled status.
 void ok()
          On 'ok' button pressed.
 void okToAll()
          On 'ok to all' button pressed.
 void onAfter(nu.xom.Node node, IContext context, IResultSet result)
          Perform some action after plugin execution for a given node.
 ENext onBefore(nu.xom.Node node, IContext context, IResultSet result)
          Perform some action before building plugin for a given node.
 void reset()
          Reset listener state.
 void setCondition(Boolean condition)
          Set pause condition.
 void setPauseOnFailure(Boolean pauseOnFailure)
          Set pause on errors.
 void setShowDialog(Boolean showDialog)
          Set the dialog status.
protected  void showDialog(StringBuilder sb)
          Show message dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FEATURE_CONDITION

public static final String FEATURE_CONDITION
Default conditional feature.


FEATURE_PAUSE_ON_FAILURE

public static final String FEATURE_PAUSE_ON_FAILURE
Enable pause on errors.


FEATURE_SHOW_DIALOG

public static final String FEATURE_SHOW_DIALOG
Enable error dialog on failures.

Constructor Detail

PauseOnFailureNodeListener

public PauseOnFailureNodeListener()
Method Detail

getName

public String getName()
Description copied from interface: ISpecRunnerListener
The listener name. Used to distinguish between different listeners.

Specified by:
getName in interface ISpecRunnerListener
Returns:
The listener name.

getCondition

public Boolean getCondition()
Condition to enable pause on failure behavior.

Returns:
true, if pause on failure can pause, false, otherwise.

setCondition

public void setCondition(Boolean condition)
Set pause condition.

Parameters:
condition - true, if pause listener can pause, false, otherwise.

getPauseOnFailure

public Boolean getPauseOnFailure()
The pause status.

Returns:
true, for pause on errors, false, otherwise.

setPauseOnFailure

public void setPauseOnFailure(Boolean pauseOnFailure)
Set pause on errors.

Parameters:
pauseOnFailure - true, for pause, false, otherwise.

getShowDialog

public Boolean getShowDialog()
The dialog enabled status.

Returns:
true, if dialog is enabled, false, otherwise.

setShowDialog

public void setShowDialog(Boolean showDialog)
Set the dialog status.

Parameters:
showDialog - true, to show dialog, false, otherwise.

reset

public void reset()
Description copied from interface: ISpecRunnerListener
Reset listener state.

Specified by:
reset in interface ISpecRunnerListener

onBefore

public ENext onBefore(nu.xom.Node node,
                      IContext context,
                      IResultSet result)
Description copied from interface: INodeListener
Perform some action before building plugin for a given node.

Specified by:
onBefore in interface INodeListener
Overrides:
onBefore in class AbstractNodeListener
Parameters:
node - The node.
context - The context.
result - The result.
Returns:
The next step on execution. If return is ENext.DEEP, the execution should go deeper.

onAfter

public void onAfter(nu.xom.Node node,
                    IContext context,
                    IResultSet result)
Description copied from interface: INodeListener
Perform some action after plugin execution for a given node.

Specified by:
onAfter in interface INodeListener
Overrides:
onAfter in class AbstractNodeListener
Parameters:
node - The node.
context - The context.
result - The result.

showDialog

protected void showDialog(StringBuilder sb)
Show message dialog.

Parameters:
sb - The message.

ok

public void ok()
Description copied from interface: ErrorFrameListener
On 'ok' button pressed.

Specified by:
ok in interface ErrorFrameListener

okToAll

public void okToAll()
Description copied from interface: ErrorFrameListener
On 'ok to all' button pressed.

Specified by:
okToAll in interface ErrorFrameListener


Copyright © 2014. All rights reserved.