RSE
Release 1.0

org.eclipse.rse.ui.validators
Class ValidatorUserActionCommand

java.lang.Object
  extended byorg.eclipse.rse.ui.validators.ValidatorUserActionCommand
All Implemented Interfaces:
ICellEditorValidator, IInputValidator, ISystemValidator

public class ValidatorUserActionCommand
extends Object
implements ISystemValidator

This class is used to verify a user defined action's command


Field Summary
protected  SystemMessage currentMessage
           
protected  SystemMessage emptyMsg
           
protected  SystemMessage invalidMsg
           
static int MAX_UDACMD_LENGTH
           
 
Constructor Summary
ValidatorUserActionCommand()
          Constructor to use when wanting to specify the "value required" error message, but use the default for the "Value not valid" error message
 
Method Summary
 int getMaximumNameLength()
          Return the max length for comments
 SystemMessage getSystemMessage()
          When isValid returns non-null, call this to get the SystemMessage object for the error versus the simple string message.
 String isValid(Object input)
           
 String isValid(String input)
           
 void setErrorMessages(SystemMessage emptyMsg, SystemMessage invalidMsg)
          Set the error messages, overriding the defaults
 SystemMessage validate(String text)
          For convenience, this is a shortcut to calling: if (isValid(text) !
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_UDACMD_LENGTH

public static final int MAX_UDACMD_LENGTH
See Also:
Constant Field Values

emptyMsg

protected SystemMessage emptyMsg

invalidMsg

protected SystemMessage invalidMsg

currentMessage

protected SystemMessage currentMessage
Constructor Detail

ValidatorUserActionCommand

public ValidatorUserActionCommand()
Constructor to use when wanting to specify the "value required" error message, but use the default for the "Value not valid" error message

Method Detail

setErrorMessages

public void setErrorMessages(SystemMessage emptyMsg,
                             SystemMessage invalidMsg)
Set the error messages, overriding the defaults


isValid

public String isValid(Object input)
Specified by:
isValid in interface ICellEditorValidator
See Also:
ICellEditorValidator.isValid(java.lang.Object)

isValid

public String isValid(String input)
Specified by:
isValid in interface IInputValidator
See Also:
IInputValidator.isValid(java.lang.String), getSystemMessage()

getSystemMessage

public SystemMessage getSystemMessage()
When isValid returns non-null, call this to get the SystemMessage object for the error versus the simple string message.

Specified by:
getSystemMessage in interface ISystemValidator

getMaximumNameLength

public int getMaximumNameLength()
Return the max length for comments

Specified by:
getMaximumNameLength in interface ISystemValidator

validate

public SystemMessage validate(String text)
For convenience, this is a shortcut to calling:

  if (isValid(text) != null)
    msg = getSystemMessage();
 

Specified by:
validate in interface ISystemValidator

RSE
Release 1.0

Copyright (c) IBM Corporation and others 2000, 2006. All Rights Reserved.