Enum Class ListGridColumnType
- All Implemented Interfaces:
Serializable
,Comparable<ListGridColumnType>
,Constable
- Since:
- 4.0
- Author:
- JBStrap
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ListGridColumnType
fromDsDataType
(DataDescriptorColumnDatatype dataType) static ListGridColumnType
Returns the enum constant of this class with the specified name.static ListGridColumnType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DATE
Date column
The column displays dates. The date is displayed using the framework’s default date format. The framework’s default date format can be set using the JBStrap parameter
JBStrapParamType.DATE_FORMAT
. If we want to use a different format, a formatter implementation must be used by calling the methodListGridColumn.setFormatter(ListGridCellFormatter)
. If you want to modify only the displayed format, use theListGridDateFormatter
class.The default alignment setting for the displayed date is center-aligned. If you want a different alignment, it must be specified for the column using the method
ListGridColumn.setAlignment(ListGridColumnAlignment)
.All DataDescriptor columns with the data type
DataDescriptorColumnDatatype.DATE
are displayed in a date column. -
DATETIME
Column with date and time
Dates containing time are displayed in this columns. The date is displayed using the framework’s default date format. The framework’s default date and time format can be set using the JBStrap parameter
JBStrapParamType.DATETIME_FORMAT
. If you want to use a different format, a formatter must be implemented by using the methodListGridColumn.setFormatter(ListGridCellFormatter)
. If you want to modify only the display format, use theListGridDateFormatter
class.The default alignment setting for the time is center-aligned. If you want a different alignment, it must be specified for the column using the method
ListGridColumn.setAlignment(ListGridColumnAlignment)
.All DataDescriptor columns with the data type
DataDescriptorColumnDatatype.DATETIME
are displayed in a date and time column. -
NUMBER
Numeric column
The column displays numeric data. Numeric values in the column are not formatted, but converted to text. Formatting the numbers or attaching prefixes/postfixes to them can be achieved by using the formatter method
ListGridColumn.setFormatter(ListGridCellFormatter)
.Numeric data are by default aligned to the right. If you want to use a different alignment, use the method
ListGridColumn.setAlignment(ListGridColumnAlignment)
.All DataDescriptor columns with the data type
DataDescriptorColumnDatatype.INTEGER
,DataDescriptorColumnDatatype.DOUBLE
orDataDescriptorColumnDatatype.LONG
are displayed in a numeric column. -
BOOLEAN
Boolean column
The column displays boolean values. If the value is a
Boolean
type value and it istrue
, the column says “Yes”, otherwise "No”. In order to display the boolean values in a different way, a custom formatter must be implemented. To do this, use theListGridColumn.setFormatter(ListGridCellFormatter)
method. Use theListGridBooleanFormatter
class to modify the displayed texts. This enables you to set the text for TRUE and FALSE values.The default alignment setting for the displayed value is center-aligned. If you want to use a different alignment, it must be set using the
ListGridColumn.setAlignment(ListGridColumnAlignment)
method.All DataDescriptor columns with the data type
DataDescriptorColumnDatatype.BOOLEAN
are displayed in a boolean column. -
TEXT
Text column
The column displays text data. If the value is not a text value, it is displayed converted to text. The default alignment setting is left-aligned. If you want to use a different alignment, it must be set using the
ListGridColumn.setAlignment(ListGridColumnAlignment)
method.All DataDescriptor columns with the data type
DataDescriptorColumnDatatype.TEXT
or columns with unassigned data type are displayed in a text column. -
CUSTOM
Custom column
By default, no formatting or alignment is set for the column. The column is used if the displayed content is rendered by a custom cell renderer class. This happens when you want to display a single or multiple components in the column. Read the description of the
ListGridCellRenderer
interface for more details on custom renderer. Use theListGridColumn.setRenderer(ListGridCellRenderer)
method to set the custom renderer class for the column.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getStyleClass
- Returns:
- The column’s style class or
null
if there is no style class for the column
-
getDefaultColumnFormatter
- Returns:
- An instance of the column’s default formatter class or
null
if there is no formatter class for the column
-
getDefaultAlignment
- Returns:
- The column’s default alignment or
null
if no default alignment is set for the column
-
fromDsDataType
- Parameters:
dataType
- The data type of the DataDescriptor- Returns:
- List grid column type for the specified data type or
null
if there is no column type for the specified data type
-