Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.subsystems.files.core.util
Class ValidatorFileFilterString


java.lang.Object
  extended by 

org.eclipse.rse.ui.validators.ValidatorUniqueString
      extended by 
org.eclipse.rse.subsystems.files.core.util.ValidatorFileFilterString
All Implemented Interfaces:
IInputValidator, ICellEditorValidator, ISystemValidator, ISystemValidatorUniqueString

public class ValidatorFileFilterString
extends ValidatorUniqueString

This class is used in dialogs that prompt for file filter strings. File filter strings are a bit complex to validate. They have to be:

  • Unique within their filter
  • Valid generic names (there are rules regarding number and location of asterisks)
  • Either a valid file or folder name, or both, when the asterisks are substituted with a letter like 'A'

The IInputValidator interface is implemented by our parent and it is used by jface's InputDialog class and property sheet window.

If you subclass this, consider overriding the getFileNameValidator and getFolderNameValidator methods.


Field Summary
protected  boolean isFileName
           
protected  boolean isFolderName
           
protected   SystemMessage msg_Invalid
           
protected   IWorkspace workspace
           
 
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
ValidatorFileFilterString ( IRemoteFileSubSystemConfiguration ssConfig)
          Use this constructor when the name need not be unique, and you just want the syntax checking.
ValidatorFileFilterString ( IRemoteFileSubSystemConfiguration ssConfig, String[] existingList)
          Constructor accepting an Array for the list of existing names.
ValidatorFileFilterString ( IRemoteFileSubSystemConfiguration ssConfig, Vector existingList)
          Constructor accepting a Vector for the list of existing names.
 
Method Summary
protected   ValidatorFileName getFileNameValidator ()
          Overridable extension point to get basic file name validator By default, queries it from the file subsystem configuration
protected   ValidatorFolderName getFolderNameValidator ()
          Overridable extension point to get basic folder name validator By default, queries it from the file subsystem configuration
 int getMaximumNameLength ()
          Return the max length for this file or folder name
protected  boolean isCaseSensitive ( IRemoteFileSubSystemConfiguration ssConfig)
          Return true if case sensitive, false it not.
  SystemMessage isSyntaxOk ( String newText)
          Validate each character.
 void setErrorMessages ( SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid)
          Supply your own error message text.
 void setIsFileName (boolean is)
          Call this before calling isValid!
 void setIsFolderName (boolean is)
          Call this before calling isValid!
  String toString ()
           
 
Methods inherited from class org.eclipse.rse.ui.validators. ValidatorUniqueString
doMessageSubstitution, getExistingNamesList, 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

msg_Invalid

protected 
SystemMessage msg_Invalid

workspace

protected 
IWorkspace workspace

isFileName

protected boolean isFileName

isFolderName

protected boolean isFolderName
Constructor Detail

ValidatorFileFilterString

public ValidatorFileFilterString(
IRemoteFileSubSystemConfiguration ssConfig,
                                 
Vector existingList)
Constructor accepting a Vector for the list of existing names.

Parameters:
ssConfig - - The remote subsystem configuration we are validating filter strings in
existingList - - A vector containing list of existing filter names to compare against. Note that toString() is used to get the string from each item.

ValidatorFileFilterString

public ValidatorFileFilterString(
IRemoteFileSubSystemConfiguration ssConfig,
                                 
String[] existingList)
Constructor accepting an Array for the list of existing names.

Parameters:
ssConfig - - The remote subsystem configuration we are validating filter strings in
existingList - - An array containing list of existing strings to compare against.

ValidatorFileFilterString

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

Parameters:
ssConfig - - The remote subsystem configuration we are validating filter strings in
Method Detail

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

setIsFileName

public void setIsFileName(boolean is)
Call this before calling isValid! Specify true if this is a file name filter

See Also:
setIsFolderName(boolean)

setIsFolderName

public void setIsFolderName(boolean is)
Call this before calling isValid! Specify true if this is a folder name filter

See Also:
setIsFileName(boolean)

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

getFileNameValidator

protected 
ValidatorFileName getFileNameValidator()
Overridable extension point to get basic file name validator By default, queries it from the file subsystem configuration


getFolderNameValidator

protected 
ValidatorFolderName getFolderNameValidator()
Overridable extension point to get basic folder name validator By default, queries it from the file subsystem configuration


isCaseSensitive

protected boolean isCaseSensitive(
IRemoteFileSubSystemConfiguration ssConfig)
Return true if case sensitive, false it not. By default, return ssConfiguration.isUnixStyle()

Parameters:
ssConfig - subsystem configuration

getMaximumNameLength

public int getMaximumNameLength()
Return the max length for this file or folder name

Specified by:
getMaximumNameLength in interface ISystemValidator
Overrides:
getMaximumNameLength in class ValidatorUniqueString

toString

public 
String toString()
Overrides:
toString in class ValidatorUniqueString

RSE
Release 3.0

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

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire