RSE
Release 3.2

org.eclipse.rse.ui.validators
Class ValidatorPathName

java.lang.Object
  extended by org.eclipse.rse.ui.validators.ValidatorUniqueString
      extended by org.eclipse.rse.ui.validators.ValidatorPathName
All Implemented Interfaces:
IInputValidator, ICellEditorValidator, ISystemValidator, ISystemValidatorUniqueString
Direct Known Subclasses:
ValidatorLocalPath

public class ValidatorPathName
extends ValidatorUniqueString

This class is used in dialogs that prompt for a name that eventually needs to become a folder path. Simply checks for a few obviously bad characters. The IInputValidator interface is used by jface's InputDialog class and numerous other platform and system classes.


Field Summary
protected  boolean fUnique
           
protected  SystemMessage msg_Invalid
           
protected  StringBuffer specialChars
           
 
Fields inherited from class org.eclipse.rse.ui.validators.ValidatorUniqueString
CASE_INSENSITIVE, CASE_SENSITIVE, caseSensitive, currentMessage, existingList, msg_Empty, msg_NonUnique, QUOTE, syntaxValidator, useUpperCase
 
Constructor Summary
ValidatorPathName()
          Use this constructor when the name need not be unique, and you just want the syntax checking.
ValidatorPathName(Collection existingNameList)
          Use this constructor when the name must be unique.
ValidatorPathName(String[] existingNameList)
          Use this constructor when the name must be unique.
 
Method Summary
protected  boolean containsSpecialCharacters(String newText)
           
protected  void init()
           
 SystemMessage isSyntaxOk(String newText)
          Validate each character.
 void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid)
          Supply your own error message text.
 String toString()
           
 
Methods inherited from class org.eclipse.rse.ui.validators.ValidatorUniqueString
doMessageSubstitution, getExistingNamesList, getMaximumNameLength, getSystemMessage, getSystemMessageText, isValid, isValid, quotedToLowerCase, setCaseSensitive, setErrorMessages, setExistingNamesList, setExistingNamesList, setUseUpperCase, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fUnique

protected boolean fUnique

msg_Invalid

protected SystemMessage msg_Invalid

specialChars

protected StringBuffer specialChars
Constructor Detail

ValidatorPathName

public ValidatorPathName(Collection existingNameList)
Use this constructor when the name must be unique.

Parameters:
existingNameList - a collection of existing names to compare against. This will not be modified by the validator.

ValidatorPathName

public ValidatorPathName(String[] existingNameList)
Use this constructor when the name must be unique. Give the constructor a string array of existing names to compare against.


ValidatorPathName

public ValidatorPathName()
Use this constructor when the name need not be unique, and you just want the syntax checking.

Method Detail

init

protected void init()

setErrorMessages

public void setErrorMessages(SystemMessage msg_Empty,
                             SystemMessage msg_NonUnique,
                             SystemMessage msg_Invalid)
Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.

Parameters:
msg_Empty - error message when entry field is empty
msg_NonUnique - error message when value entered is not unique
msg_Invalid - error message when syntax is not valid

isSyntaxOk

public SystemMessage isSyntaxOk(String newText)
Validate each character. Override of parent method. Override yourself to refine the error checking.

Overrides:
isSyntaxOk in class ValidatorUniqueString

containsSpecialCharacters

protected boolean containsSpecialCharacters(String newText)

toString

public String toString()
Overrides:
toString in class ValidatorUniqueString

RSE
Release 3.2

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