org.rhq.enterprise.communications.util.prefs
Class DefaultSetupInstruction

java.lang.Object
  extended by org.rhq.enterprise.communications.util.prefs.SetupInstruction
      extended by org.rhq.enterprise.communications.util.prefs.DefaultSetupInstruction
Direct Known Subclasses:
PromptIfEnabledSetupInstruction

public class DefaultSetupInstruction
extends SetupInstruction

This setup instruction sets its default to the current preference value already set. If there is no preference value already set, the original default passed to the constructor takes effect.

Use this setup instruction directly or subclass it if you want to give the user the opportunity to keep the same value that already exists by providing that value as the prompt default.

Author:
John Mazzitelli

Constructor Summary
DefaultSetupInstruction(String preference_name, String default_value, SetupValidityChecker validity_checker, String prompt_message, String help_message)
           
DefaultSetupInstruction(String preference_name, String default_value, SetupValidityChecker validity_checker, String prompt_message, String help_message, boolean no_echo_prompt)
           
 
Method Summary
 void preProcess()
          This sets the default value to the current value found in the preferences.
 
Methods inherited from class org.rhq.enterprise.communications.util.prefs.SetupInstruction
getDefaultValue, getHelpMessage, getPreferenceName, getPreferences, getPromptMessage, getValidityChecker, isUsingNoEchoPrompt, postProcess, setDefaultValue, setHelpMessage, setPreferences, setPromptMessage, setUsingNoEchoPrompt, setValidityChecker, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultSetupInstruction

public DefaultSetupInstruction(String preference_name,
                               String default_value,
                               SetupValidityChecker validity_checker,
                               String prompt_message,
                               String help_message)
                        throws IllegalArgumentException
Throws:
IllegalArgumentException
See Also:
SetupInstruction.SetupInstruction(String, String, SetupValidityChecker, String, String, boolean)

DefaultSetupInstruction

public DefaultSetupInstruction(String preference_name,
                               String default_value,
                               SetupValidityChecker validity_checker,
                               String prompt_message,
                               String help_message,
                               boolean no_echo_prompt)
                        throws IllegalArgumentException
Throws:
IllegalArgumentException
See Also:
SetupInstruction.SetupInstruction(String, String, SetupValidityChecker, String, String, boolean)
Method Detail

preProcess

public void preProcess()
This sets the default value to the current value found in the preferences. If there is no preference value currently set, the original SetupInstruction.getDefaultValue() remains in effect.

Overrides:
preProcess in class SetupInstruction
See Also:
SetupInstruction.preProcess()


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.