Package overit.geocall.basic.ui.control
Class ColumnMeasure
java.lang.Object
overit.geocall.platform.ui.UINode
overit.geocall.ui.Component
overit.geocall.ui.Control
overit.geocall.basic.ui.control.Column
overit.geocall.basic.ui.control.ColumnDouble
overit.geocall.basic.ui.control.ColumnMeasure
- All Implemented Interfaces:
Serializable,overit.geocall.marks.MethodExposer,overit.geocall.marks.NameExposer,Badgeable,Hideable,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 side).
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 "AUTEDISTANZA" :
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 side).
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 "AUTEDISTANZA" :
<FieldList>
<item name="AUTEDISTANZA" 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
FieldsModifier and TypeFieldDescriptionprotected MeasureConverterprotected Measureprotected booleanprotected intprotected MeasureFields inherited from class overit.geocall.basic.ui.control.ColumnDouble
_any, _forced, _forcedSymbols, _format, _symbolsFields 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.org.apache.ecs.ElementgetHtmlFoot(HashGetter footValues) Returns the footer values of the columnorg.apache.ecs.ElementgetHtmlRow(EntitySet es, int row, int pagerow, ArrayList al) Returns the html element that defines the rowintGets 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.voidsetDisplayUnit(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 client 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"voidIndicates if the field must has the label on each row and not in the column's header or not.voidsetOutputPrecision(int outPrecision) Sets the output precision for the value.voidSets 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.ColumnDouble
setFORMAT, setModelProperties, setSYMBOLSMethods inherited from class overit.geocall.basic.ui.control.Column
freeResources, getAlign, getCellContent, getColumnOrder, getConfigurableProperties, getDescOrder, getDraggable, getDroppable, getGroup, getHeadControls, getHeadControls, getHeadLabel, getHtml, 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, 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, connect, 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
-
outputPrecision
protected int outputPrecision -
labelInRow
protected boolean labelInRow
-
-
Constructor Details
-
ColumnMeasure
public ColumnMeasure()
-
-
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 client 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.
-
setLABELINROW
Indicates if the field must has the label on each row and not in the column's header or not.- Parameters:
s- A string that represents a boolean value ("true" or "1", "false" or "0").
If the string is not recognized as a boolean value, it will be used the default value, that is false
-
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
Sets the output precision for the value. It is used to show the value in the field- Parameters:
s- The string that represent the number of digits of the fractional part.
-
setOutputPrecision
public void setOutputPrecision(int outPrecision) Sets the output precision for the value. It is used to show the value in the field- Parameters:
outPrecision- 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.
-
getHtmlFoot
Description copied from class:ColumnReturns the footer values of the column- Overrides:
getHtmlFootin classColumnDouble- Parameters:
footValues- TheHashGetterthat contains the values- Returns:
- The footer values of the column
-
getHtmlRow
Description copied from class:ColumnReturns the html element that defines the row- Overrides:
getHtmlRowin classColumnDouble- Parameters:
es- TheEntitySetto which the element belongsrow- The number of the rowpagerow- The number ofd the pageal- The list of values of the row- Returns:
- The html element that defines the row
-
setup
protected void setup()Description copied from class:ComponentSetup the Component- Overrides:
setupin classColumnDouble
-
getConverter
-
getDefaultLayoutLabel
- Overrides:
getDefaultLayoutLabelin classColumnDouble
-