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
protected  Boolean condition
          Pause perform condition.
static Boolean DEFAULT_MODAL
          Modal default value.
static String FEATURE_CONDITION
          Default conditional feature.
static String FEATURE_MODAL
          Modal feature.
static String FEATURE_PAUSE_ON_FAILURE
          Enable pause on errors.
static String FEATURE_SHOW_DIALOG
          Enable error dialog on failures.
protected  ErrorFrame frame
          Auxiliary frame.
protected  Boolean modal
          Modal flag.
protected  Boolean okToAll
          Flag to skip all dialog messages.
protected  Boolean pauseOnFailure
          Set true, to pause on errors.
protected  Boolean showDialog
          Set true, to show a dialog.
protected  int start
          Count to check if errors have been added.
 
Constructor Summary
PauseOnFailureNodeListener()
           
 
Method Summary
 Boolean getCondition()
          Condition to enable pause on failure behavior.
 Boolean getModal()
          Get modal information.
 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 setModal(Boolean modal)
          Set modal flag.
 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.


condition

protected Boolean condition
Pause perform condition.


FEATURE_PAUSE_ON_FAILURE

public static final String FEATURE_PAUSE_ON_FAILURE
Enable pause on errors.


pauseOnFailure

protected Boolean pauseOnFailure
Set true, to pause on errors.


FEATURE_SHOW_DIALOG

public static final String FEATURE_SHOW_DIALOG
Enable error dialog on failures.


showDialog

protected Boolean showDialog
Set true, to show a dialog.


FEATURE_MODAL

public static final String FEATURE_MODAL
Modal feature.


DEFAULT_MODAL

public static final Boolean DEFAULT_MODAL
Modal default value.


modal

protected Boolean modal
Modal flag.


frame

protected ErrorFrame frame
Auxiliary frame.


okToAll

protected Boolean okToAll
Flag to skip all dialog messages.


start

protected int start
Count to check if errors have been added.

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.

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.

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 © 2015. All rights reserved.