Class DisplayType

java.lang.Object
org.compiere.util.DisplayType

public final class DisplayType extends Object
System Display/Data Types.
        SELECT AD_Reference_ID, Name FROM AD_Reference WHERE ValidationType = 'D'
  
Version:
$Id: DisplayType.java,v 1.6 2006/08/30 20:30:44 comdivision Exp $
Author:
Jorg Janke, Teo Sarca, SC ARHIPAC SERVICE SRL
  • BF [ 1810632 ] PricePrecision error in InfoProduct (and similar)
    • Field Details

    • Constructor Details

      • DisplayType

        public DisplayType()
    • Method Details

      • isID

        public static boolean isID(int displayType)
        Returns true if (numeric) ID (Table, Search, Account, ..). (stored as Integer)
        Parameters:
        displayType - Display Type
        Returns:
        true if ID
      • isUUID

        public static boolean isUUID(int displayType)
        Returns true if UUID (TableUU, SearchUU, ..). (stored as String)
        Parameters:
        displayType - Display Type
        Returns:
        true if UUID
      • isNumeric

        public static boolean isNumeric(int displayType)
        Returns true, if DisplayType is numeric (Amount, Number, Quantity, Integer). (stored as BigDecimal)
        Parameters:
        displayType - Display Type
        Returns:
        true if numeric
      • getDefaultPrecision

        public static int getDefaultPrecision(int displayType)
        Get Default Precision. Used for databases who cannot handle dynamic number precision.
        Parameters:
        displayType - display type
        Returns:
        scale (decimal precision)
      • isText

        public static boolean isText(int displayType)
        Returns true, if DisplayType is text (String, Text, TextLong, Memo).
        Parameters:
        displayType - Display Type
        Returns:
        true if text
      • isDate

        public static boolean isDate(int displayType)
        Returns true if DisplayType is a Date. (stored as Timestamp)
        Parameters:
        displayType - Display Type
        Returns:
        true if date
      • isList

        public static boolean isList(int displayType)
        Returns true if DisplayType is a List. (stored as Text)
        Parameters:
        displayType - Display Type
        Returns:
        true if List
      • isLookup

        public static boolean isLookup(int displayType)
        Returns true if DisplayType is a VLookup (List, Table, TableDir, Search). (stored as Integer or multi-ID string separated by commas) The column must have the lookup defined in AD_Reference_Value_ID
        Parameters:
        displayType - Display Type
        Returns:
        true if Lookup
      • isLOB

        public static boolean isLOB(int displayType)
        Returns true if DisplayType is a Large Object
        Parameters:
        displayType - Display Type
        Returns:
        true if LOB
      • isTimestampWithTimeZone

        public static boolean isTimestampWithTimeZone(int displayType)
        Parameters:
        displayType -
        Returns:
        true if displayType == TimestampWithTimeZone
      • isChosenMultipleSelection

        public static boolean isChosenMultipleSelection(int displayType)
        Parameters:
        displayType -
        Returns:
        true if displayType is a ChosenMultipleSelection
      • isMultiID

        public static boolean isMultiID(int displayType)
        Parameters:
        displayType -
        Returns:
        true if displayType is a multi ID string separated by commas
      • getNumberFormat

        public static DecimalFormat getNumberFormat(int displayType, Language language, String pattern)
        Return Format for numeric DisplayType
        Parameters:
        displayType - Display Type (default Number)
        language - Language
        pattern - Java Number Format pattern e.g. "#,##0.00"
        Returns:
        number format
      • getNumberFormat

        public static DecimalFormat getNumberFormat(int displayType, Language language)
        Return Format for numeric DisplayType
        Parameters:
        displayType - Display Type (default Number)
        language - Language
        Returns:
        number format
      • getNumberFormat

        public static DecimalFormat getNumberFormat(int displayType)
        Return Format for numeric DisplayType
        Parameters:
        displayType - Display Type
        Returns:
        number format
      • getDateFormat

        public static SimpleDateFormat getDateFormat()
        Return Date Format
        Returns:
        date format
      • getDateFormat

        public static SimpleDateFormat getDateFormat(Language language)
        Return Date Format
        Parameters:
        language - Language
        Returns:
        date format
      • getDateFormat

        public static SimpleDateFormat getDateFormat(int displayType)
        Return format for date displayType
        Parameters:
        displayType - Display Type
        Returns:
        date format
      • getDateFormat

        public static SimpleDateFormat getDateFormat(int displayType, Language language)
        Return format for date displayType
        Parameters:
        displayType - Display Type (default Date)
        language - Language
        Returns:
        date format
      • getDateFormat

        public static SimpleDateFormat getDateFormat(int displayType, Language language, String pattern)
        Return format for date displayType
        Parameters:
        displayType - Display Type (default Date)
        language - Language
        pattern - Java Simple Date Format pattern e.g. "dd/MM/yy"
        Returns:
        date format
      • getDateFormat_JDBC

        public static SimpleDateFormat getDateFormat_JDBC()
        JDBC Date Format YYYY-MM-DD
        Returns:
        date format
      • getTimestampFormat_Default

        public static SimpleDateFormat getTimestampFormat_Default()
        JDBC Timestamp Format yyyy-mm-dd hh:mm:ss
        Returns:
        timestamp format
      • getTimeFormat_Default

        public static SimpleDateFormat getTimeFormat_Default()
      • getClass

        public static Class<?> getClass(int displayType, boolean yesNoAsBoolean)
        Return Storage Class. (used for MiniTable)
        Parameters:
        displayType - Display Type
        yesNoAsBoolean - - yes or no as boolean
        Returns:
        class Integer - BigDecimal - Timestamp - String - Boolean
      • getSQLDataType

        public static String getSQLDataType(int displayType, String columnName, int fieldLength)
        Get SQL DataType
        Parameters:
        displayType - AD_Reference_ID
        columnName - name
        fieldLength - length
        Returns:
        SQL Data Type in Oracle Notation
      • getDescription

        public static String getDescription(int displayType)
        Get Description
        Parameters:
        displayType - display Type
        Returns:
        display type description
      • getCurrencyFormat

        public static NumberFormat getCurrencyFormat(String langcode, String currencyCode)
        Helper method to get a currency format in a language (multi-currency and multi-language system)
        Parameters:
        langcode - language locale code
        currencyCode - currency code
        Returns:
        number format