Class OBViewUtil
- java.lang.Object
-
- org.openbravo.client.application.window.OBViewUtil
-
public class OBViewUtil extends Object
Utility methods used in generating Openbravo view representations.- Author:
- mtaal
-
-
Field Summary
Fields Modifier and Type Field Description static Element
createdByElement
static Element
createdElement
static Element
updatedByElement
static Element
updatedElement
-
Constructor Summary
Constructors Constructor Description OBViewUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.codehaus.jettison.json.JSONObject
getGridConfigurationSettings(Optional<GCSystem> sysConf, Optional<GCTab> tabConf)
Returns the grid configuration based on the field and tab informationstatic org.codehaus.jettison.json.JSONObject
getGridConfigurationSettings(Field field, Optional<GCSystem> sysConf, Optional<GCTab> tabConf)
Returns the grid configuration based on the field and tab informationstatic String
getLabel(BaseOBObject owner, List<?> trlObjects)
Generic method for computing the translated label/title.static String
getLabel(BaseOBObject owner, List<?> trlObjects, String propertyName)
static String
getLabel(Field fld)
Method for retrieving the label of a field on the basis of the current language of the user.static String
getParameterTitle(Parameter parameter, boolean purchaseTrx)
Returns parameter's title.
-
-
-
Method Detail
-
getLabel
public static String getLabel(Field fld)
Method for retrieving the label of a field on the basis of the current language of the user.- See Also:
getLabel(BaseOBObject, List)
-
getParameterTitle
public static String getParameterTitle(Parameter parameter, boolean purchaseTrx)
Returns parameter's title. Because the same Parameter Definition can be used in different windows (some being purchases, some other ones sales), sync terminology is not enough to determine its title. If this process is invoked from a window, it is required to check the window itself to decide if it is sales or purchases. Note this only takes effect in case the parameter is associated with an element and the parameter is centrally maintained.- Parameters:
parameter
- Parameter to get the title forpurchaseTrx
- Is the window for purchases or sales- Returns:
- Parameter's title
-
getLabel
public static String getLabel(BaseOBObject owner, List<?> trlObjects)
Generic method for computing the translated label/title. It assumes that the trlObjects have a property called language and name and the owner object a property called name.- Parameters:
owner
- the owner of the trlObjects (for example Field)trlObjects
- the trl objects (for example FieldTrl)- Returns:
- a translated name if found or otherwise the name of the owner
-
getLabel
public static String getLabel(BaseOBObject owner, List<?> trlObjects, String propertyName)
-
getGridConfigurationSettings
public static org.codehaus.jettison.json.JSONObject getGridConfigurationSettings(Optional<GCSystem> sysConf, Optional<GCTab> tabConf)
Returns the grid configuration based on the field and tab information- Returns:
- the grid configuration
-
getGridConfigurationSettings
public static org.codehaus.jettison.json.JSONObject getGridConfigurationSettings(Field field, Optional<GCSystem> sysConf, Optional<GCTab> tabConf)
Returns the grid configuration based on the field and tab information- Parameters:
field
- field whose grid configuration is to be obtained it can be null- Returns:
- the grid configuration
-
-