org.opensubsystems.patterns.listdata.www
Class ColumnDefinition

java.lang.Object
  extended by org.opensubsystems.patterns.listdata.www.ColumnDefinition

public class ColumnDefinition
extends java.lang.Object

Class describing one column of a list of items. This is based on the horizontal layour of the list when items are in the rows and columns contain individual attributes of the items. You can of course layour the list of items differently and this class will be then used as a description of one of the attributes in the list

Version:
$Id: ColumnDefinition.java,v 1.3 2007/02/01 07:24:33 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
Initial revision

Field Summary
static java.lang.String[] BOOLEAN_TEXTS_DISENABLED
          Possible values of boolean representation.
static java.lang.String[] BOOLEAN_TEXTS_NOYES
          Possible values of boolean representation.
 
Constructor Summary
ColumnDefinition(java.lang.String strColumnName, java.lang.String strColumnTooltip, int iColumnDataType, double dColumnWidth)
          Constructor
ColumnDefinition(java.lang.String strColumnName, java.lang.String strColumnTooltip, java.lang.String[] arrColumnBooleanValues, double dColumnWidth)
          Constructor
 
Method Summary
 java.lang.String getColumnBooleanValueNames(java.lang.String strSeparator)
          Method returns string values for boolean column.
 java.lang.String[] getColumnBooleanValues()
          Get string representation of boolean values to use for this columns.
 int getColumnDataType()
           
 java.lang.String getColumnName()
           
 java.lang.String getColumnTooltip()
           
 double getColumnWidth()
           
 boolean isColumnMandatory()
          Check if the column has to be displayed when displaying list of items or not.
 void setColumnMandatory(boolean isColumnMandatory)
          Specify if the column has to be displayed when displaying list of items or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOOLEAN_TEXTS_DISENABLED

public static final java.lang.String[] BOOLEAN_TEXTS_DISENABLED
Possible values of boolean representation.


BOOLEAN_TEXTS_NOYES

public static final java.lang.String[] BOOLEAN_TEXTS_NOYES
Possible values of boolean representation.

Constructor Detail

ColumnDefinition

public ColumnDefinition(java.lang.String strColumnName,
                        java.lang.String strColumnTooltip,
                        int iColumnDataType,
                        double dColumnWidth)
Constructor

Parameters:
strColumnName - - column heading name
strColumnTooltip - - column tooltip
iColumnDataType - - type of data displayed in this column, one of the DataCondition.VALUE_TYPE_XYZ constants
dColumnWidth - - width of the column heading as a relative number compared to the width of other columns. 0 is valid value and means that the columns shouldn't be displayed

ColumnDefinition

public ColumnDefinition(java.lang.String strColumnName,
                        java.lang.String strColumnTooltip,
                        java.lang.String[] arrColumnBooleanValues,
                        double dColumnWidth)
Constructor

Parameters:
strColumnName - - column heading name
strColumnTooltip - - column tooltip
arrColumnBooleanValues - - array of boolean values that will be used to display booleans values in this column assuming that the column data type is boolean. Index 0 represents value for false and index 1 represents value for true. Provide are common use values in form of BOOLEAN_TEXTS_XYZ contants
dColumnWidth - - width of the column heading as a relative number compared to the width of other columns. 0 is valid value and means that the columns shouldn't be displayed
Method Detail

getColumnWidth

public double getColumnWidth()
Returns:
double - columnWidth

getColumnName

public java.lang.String getColumnName()
Returns:
String - columnName

getColumnDataType

public int getColumnDataType()
Returns:
int - columnDataType

getColumnTooltip

public java.lang.String getColumnTooltip()
Returns:
String - columnTooltip

getColumnBooleanValues

public java.lang.String[] getColumnBooleanValues()
Get string representation of boolean values to use for this columns.

Returns:
String[] - index 0 represents value for false and index 1 represents value for true.

getColumnBooleanValueNames

public java.lang.String getColumnBooleanValueNames(java.lang.String strSeparator)
Method returns string values for boolean column. These values are separated by separator.

Parameters:
strSeparator - - separator the values will be separated by
Returns:
String - value names of the boolean column [value for false][separator][value for true].

isColumnMandatory

public boolean isColumnMandatory()
Check if the column has to be displayed when displaying list of items or not. Column should be flagged as mandatory to be displayed if it is for example used as a navigation element (e.g. hyperlink) to access data (for example name of the data). This is used when constructing list definition since the user interface can indicate the user what columns will be displayed regardless of his/her choice.

Returns:
boolean - true if the column is mandatory false otherwise

setColumnMandatory

public void setColumnMandatory(boolean isColumnMandatory)
Specify if the column has to be displayed when displaying list of items or not. Column should be flagged as mandatory to be displayed if it is for example used as a navigation element (e.g. hyperlink) to access data (for example name of the data). This is used when constructing list definition since the user interface can indicate the user what columns will be displayed regardless of his/her choice.

Parameters:
isColumnMandatory - - true if the column is mandatory false otherwise


Copyright © 2003 - 2006 OpenSubsystems s.r.o.