Package overit.geocall.basic.ui.control
Class ColumnInputMeasure
- All Implemented Interfaces:
Serializable,overit.geocall.marks.MethodExposer,overit.geocall.marks.NameExposer,Badgeable,Hideable,ValueValidator,Identified,Tool,overit.geocall.ux.configurability.UIConfigurable,overit.geocall.ux.edm.ModelConfigurable
The class implements and manages the conversion between different units of measure.
Given the unit of measurement that represent the values in input (and a forced display unit if needed) and a value, the component manages the conversion to the units of measurement indicated in the language user's cultural conventions (server to client and client to server).
To set the managed internal unit it is possible to define it directly on the component (see
Here is an example on how to define a default input confUnit (Kilometer) for a field named "AUSEDISTANCE" :
To set the otuput display unit it is possible to define it directly on the component (see
To define a cultural convention regarding the unit of measurement to be displayed in client side, associated to the kilometers units (for example), simply set a rule like this "$MEASURE_km=mi,2" into the dictionary.
If there's no display unit set, the display unit will be represent by the unit.
The units of measures for which the conversion can currently be managed are:
Given the unit of measurement that represent the values in input (and a forced display unit if needed) and a value, the component manages the conversion to the units of measurement indicated in the language user's cultural conventions (server to client and client to server).
To set the managed internal unit it is possible to define it directly on the component (see
setUNIT(java.lang.String) and setUnit(overit.geocall.util.measure.Measure) ) or set a default one on the cofiguration's file into the FieldList tag.Here is an example on how to define a default input confUnit (Kilometer) for a field named "AUSEDISTANCE" :
<FieldList>
<item name="AUSEDISTANCE" unit="km"/>
</FieldList>
If there's no unit it's set will be thrown an ApplicationException.To set the otuput display unit it is possible to define it directly on the component (see
setDISPLAYUNIT(java.lang.String) and setDisplayUnit(overit.geocall.util.measure.Measure)).To define a cultural convention regarding the unit of measurement to be displayed in client side, associated to the kilometers units (for example), simply set a rule like this "$MEASURE_km=mi,2" into the dictionary.
If there's no display unit set, the display unit will be represent by the unit.
The units of measures for which the conversion can currently be managed are:
- For the Distances category:
- Kilometers (km)
- Meters (m)
- Centimeters (cm)
- Millimeters (mm)
- Miles (mi)
- Yards (yd)
- Feet (ft)
- Inches (in)
- For the Weights category:
- Kilograms (kg)
- Grams (g)
- Centigrams (cg)
- Milligrams (mg)
- Stone (st)
- Pounds (lb)
- Ounces (oz)
- For the Temperatures category:
- Kelvin (K)
- Celsius (°C)
- Fahrenheit (°F)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class overit.geocall.ui.Component
Component.Configurable, Component.ConfigurableAttribute, Component.ConfigurableAttributes, Component.FilterCriteria, Component.Registry -
Field Summary
FieldsFields inherited from class overit.geocall.basic.ui.control.ColumnInputDouble
_any, _greater, _groupingSeparator, _groupingSize, _less, _msgCampoMaggioreUguale, _msgCampoMinoreUguale, _msgCampoNumerico, _msgDecrementa, _msgIncrementa, _msgInserireUnNumeroIntero, _msgInserireUnNumeroReale, _outputPrecision, _precision, _separatorFields inherited from class overit.geocall.basic.ui.control.ColumnInputRegExp
_regexpFields inherited from class overit.geocall.basic.ui.control.ColumnInput
_autoevent, _autoeventanchor, _autoeventmsg, _autoeventparam, _defaultFocus, _indexed, _maxlength, _msg, _msgCampoObbligatorio, _msgErroreCampo, _notnull, _numeric, _placeholder, _size, _tabbed, workingRowFields inherited from class overit.geocall.basic.ui.control.Column
_align, _bkgColorFirst, _bkgColorName, _blankvisible, _breakChars, _colorIndex, _columnorder, _descorder, _descorderQuery, _draggable, _droppable, _errorvalue, _ffGroup, _ffName, _ffTitle, _footer, _group, _groupname, _groupObject, _heading, _headTitle, _key, _labelspan, _minWidth, _msgErrore, _order, _orderQuery, _rovisible, _rowspan, _stuck, _td, _tdColor, _titleFormat, _tmColorSwitch, _userHidden, _valign, _value, _visible, _width, ALIGN_ATTRIBUTE, configuredAlign, configuredDescOrder, configuredGroup, configuredMinWidth, configuredOrder, configuredRowInLine, configuredStuck, configuredTruncate, configuredValign, configuredWidth, GROUP_ATTRIBUTE, inline, MIN_WIDTH_ATTRIBUTE, ORDER_ASC_VALUE, ORDER_ATTRIBUTE, ORDER_DESC_VALUE, ORDER_EITHER_VALUE, ROW_IN_LINE_ATTRIBUTE, STUCK_ATTRIBUTE, text, truncate, TRUNCATE_ATTRIBUTE, VERTICAL_ALIGN_ATTRIBUTE, WIDTH_ATTRIBUTEFields inherited from class overit.geocall.ui.Control
_blank, _cleaner, _dblink, _enabled, _ro, _title, altEventIconsList, altIcon, ariaDescription, ariaLabel, badge, badgeformat, FILTER_PREFIXES, LABEL_ATTRIBUTE, LABEL_IN_LINE_ATTRIBUTE, STATE_BLANK, STATE_NORMAL, STATE_RO, STATE_ROBLANKFields inherited from class overit.geocall.ui.Component
_basic, _childrenContainers, _currentId, _gridalign, _gridcols, _gridrows, _gridvalign, _iconElement, _id, _keylabel, _label, _layoutName, _name, _parentContainer, _registryName, _shortcut, _tabindex, _transformations, _valuesContainer, aliasField, BR, configHidden, configuredLabel, configuredLabelInLine, defaultHidden, ELEMENT_BR, ELEMENT_NULL, entityContainer, entityName, extendedField, fullHeight, important, labelInLine, layoutLabel, PIXEL_IMG, safeInlineService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MeasureConvertergetConverter(Measure input, Measure output) Gets theMeasurewith which show the value on server side.intGets the output precision for the value.getUnit()Gets theMeasurefrom which starts the conversion and that represent the unit whith which the value is represent on server side.protected Stringprotected StringvoidsetDisplayUnit(Measure displayUnit) Sets theMeasurewith which show the value on server side.
The value will be converted (on the client side) into the display unit set, according to what has been set in the user's language dictionary.
For example, if it's set (as cultural convention) that $MEASURE_km=mi,2, it means that the display unit "km" will be converted into "mi"voidsetDISPLAYUNIT(String displayUnit) Sets unit of measurement with which show the value on server side.
The value will be converted (on the client side) into the display unit set, according to what has been set in the user's language dictionary.
For example, if it's set (as cultural convention) that $MEASURE_km=mi,2, it means that the display unit "km" will be converted into "mi"voidsetOutputPrecision(int outputPrecision) Sets the output precision for the value.voidSets theMeasurefrom which starts the conversion and that represent the unit whith which the value is represent on server side.
This unit of measure will be considered as the server side unit for the component, only if the unit attribute it's not set into the configuration file for this field.voidSets the unit of measurement, from which starts the conversion and that represent the unit whith which the value is shown on server side.protected voidsetup()Setup the ComponentMethods inherited from class overit.geocall.basic.ui.control.ColumnInputDouble
getHtmlRow, getIncrementLink, setGREATER, setGROUPINGSIZE, setINCREMENT, setLESS, setOUTPUTPRECISION, setPRECISION, validateMethods inherited from class overit.geocall.basic.ui.control.ColumnInputRegExp
setREGEXPMethods inherited from class overit.geocall.basic.ui.control.ColumnInput
checkAutoEvent, checkAutoEvent, connect, defaultAttributes, indexedName, prepareName, registerValidators, setAUTOEVENT, setAUTOEVENTANCHOR, setAUTOEVENTMSG, setAUTOEVENTPARAM, setDEFAULTFOCUS, setINDEXED, setMAXLENGTH, setMsg, setMSG, setNOTNULL, setPlaceholder, setPLACEHOLDER, setSIZE, setTABBED, validate, validateChangingValue, validateConcreteValue, validateNotNull, validateUnchangingValue, validateValueMethods inherited from class overit.geocall.basic.ui.control.Column
freeResources, getAlign, getCellContent, getColumnOrder, getConfigurableProperties, getDescOrder, getDraggable, getDroppable, getGroup, getHeadControls, getHeadControls, getHeadLabel, getHtml, getHtmlFoot, getLABELSPAN, getLayoutName, getMinWidth, getOrder, getRowInLine, getStuck, getTD, getTD, getTD, getTDColor, getTF, getTruncate, getUserHidden, getVAlign, getVISIBLE, getWidth, groupable, grouped, isHiddenByConfiguration, isUserDraggable, isUserHideable, isVisible, newGroup, setALIGN, setBKGCOLORFIRST, setBKGCOLORNAME, setBKGCOLORSWITCH, setBLANKVISIBLE, setBREAKCHARS, setConfiguredProperty, setDEFAULTHIDDEN, setDESCORDER, setDESCORDERQUERY, setDRAGGABLE, setDROPPABLE, setERRORVALUE, setFOOTER, setGROUP, setGROUPNAME, setHEADING, setHEADTITLE, setINLINE, setKEY, setLABELSPAN, setMINWIDTH, setMinWidthAndWidth, setModelProperties, setORDER, setORDERFIELD, setORDERQUERY, setROVISIBLE, setSTUCK, setTEXT, setTITLEFORMAT, setTITLENAME, setTooltipAndStyleOnLabel, setTRUNCATE, setupMetaData, setupTDColor, setupTitle, setUserHidden, setVALIGN, setVALUE, setVISIBLE, setWIDTHMethods inherited from class overit.geocall.ui.Control
avoidNull, clean, getBadgeFormat, getBadgeValue, getBLANK, getCleaner, getDAValues, getDBLINK, getKEYLABEL, getLABEL, getRO, getState, getTITLE, getValues, getWM, isEnabled, isEnabledBasedOnFunction, isFunctionEnabled, isImportant, isRoBasedOnFunction, nameWithNoFilterPrefix, setALTEVENTICON, setALTICON, setARIADESCRIPTION, setARIALABEL, setBADGEFORMAT, setBADGEVALUE, setBLANK, setCLEANER, setDBLINK, setENABLED, setFUNCTION, setRO, setTitle, setTITLEMethods inherited from class overit.geocall.ui.Component
adapt, ajaxQuery, appendAttribute, buildDisplayScript, buildSetupScript, calcKeyLabel, calcLabel, calcShortcut, canBeConfigured, changed, clearConfiguredProperties, componentIterator, componentSize, containerIterator, createAjaxFrame, deprecate, fillSetupScript, generateFlexableFullHeightContainer, generateId, getBASIC, getBoolean, getBoolean, getChildrenComponents, getChildrenContainers, getDefaultLabel, getEntityContainer, getEntityName, getFullHeight, getGridAlign, getGridCols, getGridRows, getGridVAlign, getHtmlLabel, getHtmlLabel, getIcon, getId, getIdentity, getint, getLayoutLabel, getNAME, getParentComponent, getParentContainer, getPublishedChildrenList, getRegistryName, getSHORTCUT, getTabIndex, getTeacher, getValuesContainer, getWindow, initChilds, isActivable, isActive, isAliasField, isConfigHidden, isDefaultHidden, isExtendedField, isLabelInLine, onInit, setActivable, setActive, setAliasField, setBASIC, setConfigHidden, setEntityName, setExtendedField, setFULLHEIGHT, setGRIDALIGN, setGRIDCOLS, setGRIDROWS, setGRIDVALIGN, setICON, setIdentity, setIMPORTANT, setLabel, setLABEL, setLABELINLINE, setLAYOUTLABEL, setLAYOUTNAME, setNAME, setREGISTRYNAME, setTooltip, setValuesContainer, stringForJs, tabIndexerMethods inherited from class overit.geocall.platform.ui.UINode
addChild, addChildText, getChildren, getNodeId, getParent, getRoot, getSchema, setNodeId, setParent, setSchemaMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface overit.geocall.ui.Badgeable
badgeFormat, makeBadgedIcon
-
Field Details
-
unit
-
displayUnit
-
converter
-
-
Constructor Details
-
ColumnInputMeasure
public ColumnInputMeasure()
-
-
Method Details
-
setUNIT
Sets the unit of measurement, from which starts the conversion and that represent the unit whith which the value is shown on server side.- Parameters:
unit- The unit of measurement, from which starts the conversion and that represent the unit whith which the value is shown on server side.
-
setDISPLAYUNIT
Sets unit of measurement with which show the value on server side.
The value will be converted (on the client side) into the display unit set, according to what has been set in the user's language dictionary.
For example, if it's set (as cultural convention) that $MEASURE_km=mi,2, it means that the display unit "km" will be converted into "mi"- Parameters:
displayUnit- The unit of measurement with which show the value on client side.
-
setUnit
Sets theMeasurefrom which starts the conversion and that represent the unit whith which the value is represent on server side.
This unit of measure will be considered as the server side unit for the component, only if the unit attribute it's not set into the configuration file for this field.- Parameters:
unit- The MeasureWrapper of measurement from which starts the conversion and that represent the unit whith which the value is represent on server side.
-
setDisplayUnit
Sets theMeasurewith which show the value on server side.
The value will be converted (on the client side) into the display unit set, according to what has been set in the user's language dictionary.
For example, if it's set (as cultural convention) that $MEASURE_km=mi,2, it means that the display unit "km" will be converted into "mi"- Parameters:
displayUnit- The unit of measurement with which show the value on client side.
-
getUnit
Gets theMeasurefrom which starts the conversion and that represent the unit whith which the value is represent on server side.- Returns:
- The
Measurefrom which starts the conversion and that represent the unit whith which the value is represent on server side.
-
getDisplayUnit
Gets theMeasurewith which show the value on server side.- Returns:
- The
Measurewith which show the value on server side.
-
setOutputPrecision
public void setOutputPrecision(int outputPrecision) Sets the output precision for the value. It is used to show the value in the field- Parameters:
outputPrecision- The number of digits of the fractional part.
-
getOutputPrecision
public int getOutputPrecision()Gets the output precision for the value. It is used to show the value in the field- Returns:
- The number of digits of the fractional part.
-
setup
protected void setup()Description copied from class:ComponentSetup the Component- Overrides:
setupin classColumnInputDouble
-
prepareName
- Overrides:
prepareNamein classColumnInputDouble
-
prepareValue
- Overrides:
prepareValuein classColumnInputDouble
-
getConverter
-
getDefaultLayoutLabel
- Overrides:
getDefaultLayoutLabelin classColumnInputDouble
-