Package com.iizix.api.vs
Class VSFieldEvent
- All Implemented Interfaces:
- IMessageBox
The VirtualSpace Field Value Event is a multi-purpose event that is used for validation and conversion of a value type between two native types, e.g. to convert a Value from an SQL Time instance to a Boolean (where the Boolean meaning could be "Working Hours 08:00-17:00").
The class has 4 members that are public and read-only: operation, sourceType, targetType, and originalValue.
The VALIDATE event is fired when the VirtualSpace Field Value needs validation of the value to set.
The CONVERT_TO_NATIVE or CONVERT_FROM_NATIVE is fired when required (but cached result is kept).
- Author:
- Christopher Mindus
- Nested Class SummaryNested ClassesModifier and TypeClassDescription- static enumCategory for message.- static enumThe Virtual Field Event Operations.- Nested classes/interfaces inherited from interface com.iizix.gyro.IMessageBox- IMessageBox.Icon
- Field SummaryFieldsModifier and TypeFieldDescription- final VSFieldEvent.OpThe operation.- final ObjectThe original value, null when none applies.- final Value.TypeThe convert-from-type of Value.- final Value.TypeThe convert-to-type of value.- Fields inherited from interface com.iizix.gyro.IMessageBox- ICON_ERROR, ICON_INFORMATION, ICON_MAP, ICON_NONE, ICON_QUESTION, ICON_WARNING
- Constructor SummaryConstructorsConstructorDescription- VSFieldEvent- (VSField source, VSFieldEvent.Op operation, Object value, Value.Type sourceType, Value.Type targetType, GProp<?> trigger) Constructs the event for an action to use with value conversion.- VSFieldEvent- (VSField source, Value value, GProp<?> trigger) Constructs the validation event for an action with a property being the trigger source, e.g.
- Method SummaryModifier and TypeMethodDescription- booleanChecks if propagation is stopped.Gets the message category.Gets the converted value.Gets the message.Gets the VirtualSpace Field that is the source of the event.- booleanChecks if the event has been handled and no further processing by other processors should be done.- protected StringGets the parameter string.- void- setConvertedValue- (Object value) Sets the converted value and marks the event as handled.- voidMarks the event as handled and no further processing by other processors should be done.- void- setMessage- (PlainKString message, VSFieldEvent.Category category) Sets the validation message.- voidStops propagation of the event in the event processor chain.- Methods inherited from class com.iizix.api.vs.VSBaseEventWithTrigger- getTrigger, getTriggerClientSessionGyro, getTriggerUIComp- Methods inherited from class com.iizix.api.vs.VSBaseEvent- getAppSessionGyro, getVirtualSpace- Methods inherited from class com.iizix.api.BaseEvent- getAction, getAction2, getActionNull, getActionNull2, getField, getField2, getFieldNull, getFieldNull2, getGroup, getGroup2, getGroupNull, getGroupNull2, getTable, getTable2, getTableNull, getTableNull2, getTime, getVirtualizedVirtualSpace, getVSComponent, getVSComponent2, getVSComponentNull, getVSComponentNull2, messageBox, toString- Methods inherited from class java.lang.Object- clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait- Methods inherited from interface com.iizix.gyro.IMessageBox- messageBox, messageBox, messageBox
- Field Details- operationThe operation.
- originalValueThe original value, null when none applies.
- sourceTypeThe convert-from-type of Value.- This value is also set to the validating value. 
- targetTypeThe convert-to-type of value.- This value is also set to the validating value. 
 
- Constructor Details- VSFieldEventpublic VSFieldEvent- (VSField source, VSFieldEvent.Op operation, Object value, Value.Type sourceType, Value.Type targetType, GProp<?> trigger) Constructs the event for an action to use with value conversion.- Parameters:
- source- The field.
- operation- Operation to perform.
- value- The value to convert.
- sourceType- The source value type.
- targetType- The target value type.
- Throws:
- NullPointerException- If the source is null.
 
- VSFieldEventConstructs the validation event for an action with a property being the trigger source, e.g. an UIButton or UICheckBox.- Parameters:
- source- The field.
- value- The value being validated.
- trigger- The trigger property, null for none.
- Throws:
- NullPointerException- If the source or field Raw value is null.
- IllegalArgumentException- If the native form doesn't match what is expected.
 
 
- Method Details- getSourceGets the VirtualSpace Field that is the source of the event.
- setConvertedValueSets the converted value and marks the event as handled.- Parameters:
- value- The value as requested by the conversion.
- Throws:
- NullPointerException- If the value is- null.
- IllegalArgumentException- If the value class is not matching the expected conversion in- toType.
 
- getConvertedValueGets the converted value.- Returns:
- The converted value, or null if not yet converted.
 
- setMessageSets the validation message.- Parameters:
- message- The message to set, null to clear message (category will not be changed).
- category- The- Category- NONE(-1, default value),- INFORMATION(0),- WARNING(1) or- ERROR(2).
- Throws:
- NullPointerException- If- messageor- categoryis null.
 
- getCategoryGets the message category.- Returns:
- The CategoryNONE(-1, default value),INFORMATION(0),WARNING(1) orERROR(2).
 
- getMessageGets the message.- Returns:
- A message, or null for none.
 
- stopPropagationpublic void stopPropagation()Stops propagation of the event in the event processor chain.
- doStopPropagationpublic boolean doStopPropagation()Checks if propagation is stopped.
- setHandledpublic void setHandled()Marks the event as handled and no further processing by other processors should be done.
- hasBeenHandledpublic boolean hasBeenHandled()Checks if the event has been handled and no further processing by other processors should be done.
- paramStringGets the parameter string.- Overrides:
- paramStringin class- VSBaseEventWithTrigger<VSField>