|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for writing validators.
Field Summary | |
static int |
DOWN
Enum for mask returned by calculateSpinability() . |
static int |
UP
Enum for mask returned by calculateSpinability() . |
Method Summary | |
int |
calculateSpinability(Object current_value)
Finds out whether or not further spinning is possible. |
void |
changeText(com.klg.jclass.field.validate.TextEvent e)
Called by a TextChangedListener ; gives the validator an
opportunity to control the change of text. |
boolean |
compareValues(Object v1,
Object v2)
Since we cannot always rely on an object's equals() method we
must define out own compare method. |
Object |
copyValue(Object value)
Since the clone() method is protected in the Object
class, we cannot actually clone a generic object without knowing what it is;
therefore the validator must provide this routine to do the copying for
Field. |
com.klg.jclass.field.validate.PopupFieldEditor |
createPopupComponent()
Returns the PopupFieldEditor . |
String |
format(Object obj)
Generates a String representation of the given object. |
String |
formatForEdit(Object obj)
Generates a String representation of the given object for use in edit mode. |
Object |
getDefaultValue()
Returns the default value for the validator. |
int |
getFirstValidCursorPosition()
Gets the first valid cursor position. |
ListModel |
getPickList()
Returns the list of values that the end user can pick from. |
int |
getPickListIndex(Object obj)
Returns the offset into the PickList of the object. |
boolean |
hasEditFormat()
Reports whether the validator has a different edit format or not. |
void |
inferSubField(int selection_start,
int selection_end)
Infers the sub-field we need to work on from the current selected region. |
boolean |
isClassSupported(Class c)
Returns true if the object passed in is the native type that the
validator is designed to support. |
Object |
parse(Class c,
String text)
Validates the specified text, and returns a new Object if successful. |
void |
setCursor(com.klg.jclass.field.validate.TextCursorEvent e)
Sets the cursor to the specified position. |
void |
setPickList(ListModel picklist)
Sets the pick list. |
Object |
spinDown(Object current)
If the validator has the ability to "spin," this gives us the prvious value. |
Object |
spinUp(Object current)
If the validator has the ability to "spin," this gives us the next value. |
boolean |
validate(Object obj)
Validates the given object. |
Field Detail |
public static final int UP
calculateSpinability()
.
public static final int DOWN
calculateSpinability()
.
Method Detail |
public ListModel getPickList()
public void setPickList(ListModel picklist)
picklist
- public void changeText(com.klg.jclass.field.validate.TextEvent e)
TextChangedListener
; gives the validator an
opportunity to control the change of text.
e
- public Object copyValue(Object value)
clone()
method is protected in the Object
class, we cannot actually clone a generic object without knowing what it is;
therefore the validator must provide this routine to do the copying for
Field.
value
-
public boolean compareValues(Object v1, Object v2)
equals()
method we
must define out own compare method. The default implementation of this
in the AbstractValidator
class is to call equals()
If this is not sufficient, then the subclass can override this method without
having to subclass the data object.
v1
- v2
-
public void setCursor(com.klg.jclass.field.validate.TextCursorEvent e)
TextCursorEvent
for the methods setCursor()
would use to reposition the cursor, or to reset its position if
validation fails.
e
- the event triggering the repositioning of the cursorpublic Object parse(Class c, String text) throws FieldParseException
c
- sets which class object the text should be converted totext
- text to be converted to an object
FieldParseException
public boolean validate(Object obj)
obj
-
public String format(Object obj)
obj
-
public String formatForEdit(Object obj)
obj
-
public boolean hasEditFormat()
public void inferSubField(int selection_start, int selection_end)
selection_start
- selection_end
- public Object spinUp(Object current)
current
-
public Object spinDown(Object current)
current
-
public int calculateSpinability(Object current_value)
AbstractValidator.UP
and/or
AbstractValidator.DOWN
.
current_value
-
public int getFirstValidCursorPosition()
public int getPickListIndex(Object obj)
PickList
of the object.
obj
-
PickList
of the objectpublic boolean isClassSupported(Class c)
true
if the object passed in is the native type that the
validator is designed to support.
c
-
true
if the object passed in is the native typepublic Object getDefaultValue()
public com.klg.jclass.field.validate.PopupFieldEditor createPopupComponent()
PopupFieldEditor
.
PopupFieldEditor
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |