|
JClass 4.5.0 API Documentation |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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(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. |
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(TextCursorEvent e)
Sets the cursor to the specified position. |
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
public static final int DOWN
Method Detail |
public ListModel getPickList()
public void changeText(TextEvent e)
public Object copyValue(Object value)
public boolean compareValues(Object v1, Object v2)
public void setCursor(TextCursorEvent e)
text
- the current textprev_position
- the previous position of the cursornew_position
- the new position 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 objectpublic boolean validate(Object obj)
public String format(Object obj)
public String formatForEdit(Object obj)
public boolean hasEditFormat()
public void inferSubField(int selection_start, int selection_end)
public Object spinUp(Object current)
public Object spinDown(Object current)
public int calculateSpinability(Object current_value)
public int getFirstValidCursorPosition()
public int getPickListIndex(Object obj)
public boolean isClassSupported(Class c)
public Object getDefaultValue()
public PopupFieldEditor createPopupComponent()
|
Copyright© 1999-2000 KL Group Inc. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |