Class NumberUIDefinition
- java.lang.Object
-
- org.openbravo.client.kernel.reference.UIDefinition
-
- org.openbravo.client.kernel.reference.NumberUIDefinition
-
- Direct Known Subclasses:
NumberUIDefinition.AmountUIDefinition
,NumberUIDefinition.BigDecimalUIDefinition
,NumberUIDefinition.DecimalUIDefinition
,NumberUIDefinition.IntegerUIDefinition
,NumberUIDefinition.PriceUIDefinition
,NumberUIDefinition.QuantityUIDefinition
public abstract class NumberUIDefinition extends UIDefinition
Implementation of the ui definition for numbers.- Author:
- mtaal
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NumberUIDefinition.AmountUIDefinition
static class
NumberUIDefinition.BigDecimalUIDefinition
static class
NumberUIDefinition.DecimalUIDefinition
static class
NumberUIDefinition.IntegerUIDefinition
static class
NumberUIDefinition.PriceUIDefinition
static class
NumberUIDefinition.QuantityUIDefinition
-
Field Summary
-
Fields inherited from class org.openbravo.client.kernel.reference.UIDefinition
log
-
-
Constructor Summary
Constructors Constructor Description NumberUIDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
convertToClassicString(Object value)
Creates a classic string which is used by callouts from an object value.Object
createFromClassicString(String value)
Convert a string value as used in classic OB to a type safe value.String
getDefaultValue(VariablesSecureApp vars, String columnName, String defaultValueExpression, String windowId)
Returns the value for a default value expression which represents a session value or a fixed value.String
getDefaultValueFromSQLExpression(VariablesSecureApp vars, Field field, String defaultValueExpression)
Returns the value for a default value expression based on a SQL expression.String
getFieldProperties(Field field)
Computes properties to initialize and set the field in a Smartclient form.String
getFieldProperties(Field field, boolean getValueFromSession)
Computes properties to initialize and set the field in a Smartclient form.String
getFilterEditorProperties(Field field)
Computes properties to initialize and set the field in a Smartclient grid filter.String
getFilterEditorType()
String
getFormat()
String
getFormEditorType()
String
getTypeProperties()
Computes the properties used to define the type, this includes all the Smartclient SimpleType properties.-
Methods inherited from class org.openbravo.client.kernel.reference.UIDefinition
createJsonValueFromClassicValueString, establishGridConfigurationSettings, formatValueFromSQL, formatValueToSQL, getCellAlign, getDataSourceParameters, getDomainType, getFieldPropertiesFirstRecord, getFieldPropertiesWithoutCombo, getFilterEditorPropertiesProperty, getGridEditorFieldProperties, getGridEditorType, getGridFieldName, getGridFieldProperties, getName, getParameterProperties, getParameterWidth, getParentType, getReadOnlyEditorType, getReference, getSafeBoolean, getShowHoverGridFieldSettings, getValueFromSQLDefault, getValueInComboReference, getValueInComboReference, parseSQL, readGridConfigurationSetting, removeAttributeFromString, setReference, showHover
-
-
-
-
Method Detail
-
getFormEditorType
public String getFormEditorType()
- Overrides:
getFormEditorType
in classUIDefinition
- Returns:
- the form item type used for editing this reference in a form.
-
getFilterEditorType
public String getFilterEditorType()
- Overrides:
getFilterEditorType
in classUIDefinition
- Returns:
- the form item type used for filtering in grids. As a default will return
UIDefinition.getFormEditorType()
-
getFilterEditorProperties
public String getFilterEditorProperties(Field field)
Description copied from class:UIDefinition
Computes properties to initialize and set the field in a Smartclient grid filter. This can be the default value or the sets of values in the valuemap. Note: the result should be either empty, if not empty then it start with a comma and end without a comma, this to generate correct javascript.- Overrides:
getFilterEditorProperties
in classUIDefinition
- Parameters:
field
- the field for which the information should be computed.- Returns:
- a JSONObject string which is used to initialize the formitem.
-
getTypeProperties
public String getTypeProperties()
Description copied from class:UIDefinition
Computes the properties used to define the type, this includes all the Smartclient SimpleType properties.- Overrides:
getTypeProperties
in classUIDefinition
- Returns:
- a javascript string which can be included in the javascript defining the SimpleType. The default implementation returns an empty string.
-
getFieldProperties
public String getFieldProperties(Field field)
Description copied from class:UIDefinition
Computes properties to initialize and set the field in a Smartclient form. This can be the default value or the sets of values in the valuemap. NOTE: the field parameter may be null, implementors of subclasses should take this into account.- Overrides:
getFieldProperties
in classUIDefinition
- Parameters:
field
- the field for which the information should be computed. NOTE: the caller is allowed to pass null for cases where the field properties are needed for a FormItem which is not backed by an Openbravo field.- Returns:
- a JSONObject string which is used to initialize the formitem.
-
getFieldProperties
public String getFieldProperties(Field field, boolean getValueFromSession)
Description copied from class:UIDefinition
Computes properties to initialize and set the field in a Smartclient form. This can be the default value or the sets of values in the valuemap.- Overrides:
getFieldProperties
in classUIDefinition
- Parameters:
field
- the field for which the information should be computed.- Returns:
- a JSONObject string which is used to initialize the formitem.
-
getFormat
public String getFormat()
-
getDefaultValue
public String getDefaultValue(VariablesSecureApp vars, String columnName, String defaultValueExpression, String windowId)
Description copied from class:UIDefinition
Returns the value for a default value expression which represents a session value or a fixed value. This method is not used to calculate SQL based expressions (those that start with '@SQL=') and NOW expression ('@#Date@').- Overrides:
getDefaultValue
in classUIDefinition
- Parameters:
vars
- Handler for the session info.columnName
- String with the name of the column that has the default value.defaultValueExpression
- String with the default value expression.windowId
- String with the window id.- Returns:
- String with the calculated default value.
-
getDefaultValueFromSQLExpression
public String getDefaultValueFromSQLExpression(VariablesSecureApp vars, Field field, String defaultValueExpression)
Description copied from class:UIDefinition
Returns the value for a default value expression based on a SQL expression. This kind of expressions start with '@SQL='.- Overrides:
getDefaultValueFromSQLExpression
in classUIDefinition
- Parameters:
vars
- Handler for the session info.field
- Field whose column has the default value.defaultValueExpression
- String with the default value expression.- Returns:
- String with the calculated default value.
-
createFromClassicString
public Object createFromClassicString(String value)
Description copied from class:UIDefinition
Convert a string value as used in classic OB to a type safe value.- Overrides:
createFromClassicString
in classUIDefinition
- See Also:
PrimitiveDomainType.createFromString(String)
-
convertToClassicString
public String convertToClassicString(Object value)
Description copied from class:UIDefinition
Creates a classic string which is used by callouts from an object value.- Overrides:
convertToClassicString
in classUIDefinition
- Returns:
- the classic string
-
-