Class ConfirmationDialog

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ErrorHandler, InputConsumer, InteractiveActor, InteractiveActorWithCustomParentComponent, OutputProducer, StopModeSupporter, Serializable, Comparable

    public class ConfirmationDialog
    extends AbstractInteractiveTransformer
    Pops up a confirmation dialog, prompting the user to select 'yes', 'no' or 'cancel'.
    If no custom tokens are used, the current token is only forwarded when the user selects 'yes'. Otherwise the token simply gets dropped.
    In case of custom tokens, depending on the user's selection, either the user-defined 'yes', 'no' or 'cancel' string get forwarded as string tokens.
    Closing the dialog gets interpreted as selecting the 'cancel' button.

    Input/output:
    - accepts:
       adams.flow.core.Unknown
    - generates:
       adams.flow.core.Unknown


    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: ConfirmationDialog
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default:
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow execution at this level gets stopped in case this
        actor encounters an error; the error gets propagated; useful for critical
        actors.
        default: false
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console; Note: the enclosing
        actor handler must have this enabled as well.
        default: false
     
    -stop-if-canceled <boolean> (property: stopFlowIfCanceled)
        If enabled, the flow gets stopped in case the user cancels the dialog.
        default: false
     
    -custom-stop-message <java.lang.String> (property: customStopMessage)
        The custom stop message to use in case a user cancelation stops the flow
        (default is the full name of the actor)
        default:
     
    -stop-mode <GLOBAL|STOP_RESTRICTOR> (property: stopMode)
        The stop mode to use.
        default: GLOBAL
     
    -parent-component-actor <adams.flow.core.CallableActorReference> (property: parentComponentActor)
        The (optional) callable actor to use as parent component instead of the
        flow panel.
        default: unknown
     
    -use-outer-window <boolean> (property: useOuterWindow)
        If enabled, the outer window (dialog/frame) is used instead of the component
        of the callable actor.
        default: false
     
    -title <java.lang.String> (property: title)
        The title to prompt the user with (variables get expanded).
        default: Confirm
     
    -message <java.lang.String> (property: message)
        The message to prompt the user with (variables get expanded).
        default: Continue with processing of token?
     
    -custom-tokens <boolean> (property: useCustomTokens)
        If enabled, custom string tokens are forwarded based on the selection the
        user makes; otherwise the current token gets forwarded when the user selects
        'yes' and nothing for 'no'.
        default: false
     
    -yes-token <java.lang.String> (property: yesToken)
        The string to forward as token if the user chooses 'yes' in case custom
        tokens are enabled.
        default:
     
    -no-token <java.lang.String> (property: noToken)
        The string to forward as token if the user chooses 'no' in case custom tokens
        are enabled.
        default:
     
    -cancel-token <java.lang.String> (property: cancelToken)
        The string to forward as token if the user chooses 'cancel' (or closes the
        dialog) in case custom tokens are enabled.
        default:
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Title

        protected String m_Title
        the dialog title.
      • m_Message

        protected String m_Message
        the message for the user.
      • m_UseCustomTokens

        protected boolean m_UseCustomTokens
        whether to forward a custom token instead of the one currently passed through.
      • m_YesToken

        protected String m_YesToken
        the "yes" token.
      • m_NoToken

        protected String m_NoToken
        the "no" token.
      • m_CancelToken

        protected String m_CancelToken
        the "cancel" token.
    • Constructor Detail

      • ConfirmationDialog

        public ConfirmationDialog()
    • Method Detail

      • setTitle

        public void setTitle​(String value)
        Sets the title to prompt the user with.
        Parameters:
        value - the title
      • getTitle

        public String getTitle()
        Returns the title the user is prompted with.
        Returns:
        the title
      • titleTipText

        public String titleTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setMessage

        public void setMessage​(String value)
        Sets the message to prompt the user with.
        Parameters:
        value - the message
      • getMessage

        public String getMessage()
        Returns the message the user is prompted with.
        Returns:
        the message
      • messageTipText

        public String messageTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setUseCustomTokens

        public void setUseCustomTokens​(boolean value)
        Sets whether to use forward custom string tokens instead of current one.
        Parameters:
        value - if true custom tokens get forwarded
      • getUseCustomTokens

        public boolean getUseCustomTokens()
        Returns whether custom string tokens are forwared instead of current one.
        Returns:
        true if custom tokens get forwarded
      • useCustomTokensTipText

        public String useCustomTokensTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setYesToken

        public void setYesToken​(String value)
        Sets the string to forward as string token in case the user chooses 'yes', in case custom tokens are enabled.
        Parameters:
        value - the yes token
        See Also:
        getUseCustomTokens()
      • getYesToken

        public String getYesToken()
        Returns the string that gets forwarded as token in case the user chooses 'yes' as option, in case custom tokens are enabled.
        Returns:
        the yes token
        See Also:
        getUseCustomTokens()
      • yesTokenTipText

        public String yesTokenTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setNoToken

        public void setNoToken​(String value)
        Sets the string to forward as string token in case the user chooses 'no', in case custom tokens are enabled.
        Parameters:
        value - the no token
        See Also:
        getUseCustomTokens()
      • getNoToken

        public String getNoToken()
        Returns the string that gets forwarded as token in case the user chooses 'no' as option, in case custom tokens are enabled.
        Returns:
        the no token
        See Also:
        getUseCustomTokens()
      • noTokenTipText

        public String noTokenTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setCancelToken

        public void setCancelToken​(String value)
        Sets the string to forward as string token in case the user chooses 'cancel' (or closes the dialog), in case custom tokens are enabled.
        Parameters:
        value - the cancel token
        See Also:
        getUseCustomTokens()
      • getCancelToken

        public String getCancelToken()
        Returns the string that gets forwarded as token in case the user chooses 'cancel' as option (or closes the dialog), in case custom tokens are enabled.
        Returns:
        the cancel token
        See Also:
        getUseCustomTokens()
      • cancelTokenTipText

        public String cancelTokenTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • accepts

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Returns:
        adams.flow.core.Unknown.class
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        Returns:
        the class fo the generated objects