oracle.cabo.ui.validate
Class ColorValidater
java.lang.Object
|
+--oracle.cabo.ui.validate.BaseClientValidater
|
+--oracle.cabo.ui.validate.ColorValidater
- All Implemented Interfaces:
- ClientValidater, Formatter, ServerValidater
- public class ColorValidater
- extends BaseClientValidater
- implements Formatter
Validater for validating colors.
Constructor Summary |
ColorValidater(java.lang.String[] patterns,
boolean allowsTransparent)
Creates a ColorValidater. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_COLOR_FORMAT_PATTERNS
public static final java.lang.String[] DEFAULT_COLOR_FORMAT_PATTERNS
ColorValidater
public ColorValidater(java.lang.String[] patterns,
boolean allowsTransparent)
- Creates a ColorValidater.
- Parameters:
patterns
- The set of RGBColorFormat format patterns that
are accepted by this validater. The first
pattern is special - it is always used for
formatting color values.allowsTransparent
- Indicates whether or not transparent
colors are considered valid.
sharedInstance
public static ColorValidater sharedInstance()
validate
public java.text.ParseException[] validate(RenderingContext context,
java.lang.String value)
parseString
public java.lang.Object parseString(java.lang.String colorString,
LocaleContext localeContext)
throws java.text.ParseException
- Returns the value as a Color.
- Specified by:
parseString
in interface Formatter
formatObject
public java.lang.String formatObject(java.lang.Object color,
LocaleContext localeContext)
- Description copied from interface:
Formatter
- Formats the value into a String in a potentially Locale-specific manner.
- Specified by:
formatObject
in interface Formatter
getValidationFormat
public java.lang.String getValidationFormat(RenderingContext context,
UINode node)
- Overrides:
getValidationFormat
in class BaseClientValidater
getColumns
public int getColumns(LocaleContext localeContext)
writeDependencies
public void writeDependencies(RenderingContext context,
UINode node)
throws java.io.IOException
- Description copied from class:
BaseClientValidater
- Opportunity for the CLientValidater to write any of its dependencies
to the output. For HTML, this will typically be imports of
JavaScript libraries.
- Overrides:
writeDependencies
in class BaseClientValidater
setTransparentAllowed
public void setTransparentAllowed(boolean mayTrans)
isTransparentAllowed
public boolean isTransparentAllowed()
getHTMLValidation
protected java.lang.String getHTMLValidation(RenderingContext context)
- Overrides:
getHTMLValidation
in class BaseClientValidater
getHTMLLibReference
protected java.lang.String getHTMLLibReference()
- Returns the name of the Javascript code that this validator requires.
- Overrides:
getHTMLLibReference
in class BaseClientValidater