|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.enterprise.tabularresults.TableFormatService
This class provides the basic functionality for presenting a String
of objects in a tabular form. This class will present a String of
objects in a table with a header for each column and allows the user
to specify HTML attributes of the table and the rows. The embedded
Column objects allow the specification of the HTML presentation of the
header and the data that is to appear in column of the table that the
column defines. The table is created with a call to initTable and
printed out with a call to printTable. The initialization of the table
assumes that the user is sending a set of header names ( for example,
a string can be generated by a call to an instance of a subclass of
DataFormatService) . If the subclass of BasicQueryService does not
specify a set of header names to be used, TableFormatService will
look for an entry in wt.properties ( add example entry ). If there is NOT a string passed
in from the subclass of BasicQueryService used and there is NOT an
entry in wt.properties, then an exception is thrown and an error message
is sent to the webpage. The default data service, StdDataFormatService,
assumes that these names are derived attributes. Assuming that the
initialization is done correctly, then customizing the table can be
done. You can add columns, delete columns, set HTML format properties
for the Table, Rows, Columns, and single Table cell entries. Should an
invalid column ID be given during customization, an exception will be
thrown and the table will not be printed and an exception will be thrown.
One of the important aspects of using this TableFormatService is to
specify the DataFormatService subclass that is to be used to generate
the entries that are appear in the individual table cells. It will be
this service that will provide the HTML output that appears inbetween
the
in each cell in each row.
...
Supported API: false
Extendable: false
Field Summary | |
private static String |
CODEBASE
|
(package private) Vector |
columns
|
private DataFormatService |
currentDataFormatService
|
private String |
defaultDataServiceName
|
private Locale |
locale
|
private static String |
RESOURCE
|
protected String[] |
ROW_ATTRIBUTES
Defines the set of supported HTML row attributes |
private Properties |
rowProperties
rowProperties holds the HTML specific properties of the rows of the table. |
private static String |
TABLE_ALIGN_DEFAULT
|
protected String[] |
TABLE_ATTRIBUTES
Defines the set of supported HTML table attributes |
private static String |
TABLE_BEGIN_DEFAULT
|
private static String |
TABLE_BGCOLOR_DEFAULT
|
private static String |
TABLE_BORDER_DEFAULT
|
private static String |
TABLE_END_DEFAULT
|
private static String |
TABLE_WIDTH_DEFAULT
|
private String |
tableAlign
|
private String |
tableBegin
|
private String |
tableBGColor
|
private String |
tableBorder
|
private String |
tableEnd
|
private Properties |
tableProperties
tableProperties holds the HTML specific properties of table. |
private String |
tableWidth
|
private String |
TR_Begin
|
private String |
TR_End
|
private static boolean |
VERBOSE
|
Constructor Summary | |
TableFormatService()
Supported API: false |
Method Summary | |
void |
addColumn(Column new_column,
Properties properties)
Supported API: false |
void |
addDefaultColumn(String column_ID,
Properties column_properties,
Object context_obj)
Supported API: false |
void |
addToVector(Vector columns,
Column new_column,
Properties properties)
Supported API: false |
void |
deleteColumn(String column_ID)
Supported API: false |
DataFormatService |
getDataFormatService()
Supported API: false |
String |
getDataServiceName()
Supported API: false |
Locale |
getLocale()
Supported API: false |
boolean |
hasColumn(String columnID)
Supported API: false |
String[] |
initColumnNames(Object context_obj)
Supported API: false |
void |
initTable(Object[] table_entries,
Locale new_locale,
String[] column_names)
This method initializes the table by instantiating the objects that will keep track of the columns and the table properties and the row properties. |
Object |
loadClass(String className)
Supported API: false |
void |
printCaption(PrintWriter out)
Supported API: false |
void |
printHeadings(Object[] table_entries,
PrintWriter out)
Supported API: false |
void |
printRow(Object table_entry,
PrintWriter out)
Supported API: false |
void |
printTable(Object[] table_entries,
PrintWriter out)
Supported API: false |
void |
setAllColumnsProperties(Properties properties)
Supported API: false |
void |
setAllHeadersProperties(Properties properties)
Supported API: false |
void |
setColumnFormat()
Supported API: false |
void |
setColumnProperties(String column_ID,
Properties properties)
Supported API: false |
void |
setDataFormatService(DataFormatService new_data_format_service)
Supported API: false |
void |
setDataServiceName(String data_service_name)
Supported API: false |
void |
setDefaultColumnProperties(String column_ID)
Supported API: false |
void |
setDefaultColumns(Object[] context_objs,
String[] column_names)
This method is used to actually create the instances of the Column using the entries in column_names. |
void |
setDefaultRowProperties()
Supported API: false |
void |
setDefaultTableProperties()
Supported API: false |
void |
setHeader(String column_ID,
String entry)
Supported API: false |
void |
setHeaderProperties(String column_ID,
Properties properties)
Supported API: false |
void |
setLocale(Locale newLocale)
Supported API: false |
void |
setRowFormat()
Supported API: false |
void |
setRowProperties(Properties properties)
Supported API: false |
void |
setTableFormat()
Supported API: false |
void |
setTableProperties(Properties properties)
Supported API: false |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static String CODEBASE
private static boolean VERBOSE
private static final String RESOURCE
private static String TABLE_BEGIN_DEFAULT
private static String TABLE_END_DEFAULT
private static String TABLE_BGCOLOR_DEFAULT
private static String TABLE_ALIGN_DEFAULT
private static String TABLE_WIDTH_DEFAULT
private static String TABLE_BORDER_DEFAULT
private String tableBegin
private String tableEnd
private String tableBGColor
private String tableAlign
private String tableWidth
private String tableBorder
private Properties tableProperties
Vector columns
private String TR_Begin
private String TR_End
private Properties rowProperties
protected String[] TABLE_ATTRIBUTES
protected String[] ROW_ATTRIBUTES
private String defaultDataServiceName
private DataFormatService currentDataFormatService
private Locale locale
Constructor Detail |
public TableFormatService()
Method Detail |
public void setLocale(Locale newLocale)
public Locale getLocale()
public void initTable(Object[] table_entries, Locale new_locale, String[] column_names) throws WTException
table_entries
- The string of objects that are going to be used to create the table. Currently, each entry in the array presents a row in the tablenew_locale
- The locale that should be used to localize outputcolumn_names
- The list of column names. Context depends on the DataFormatService that is used. The default DataFormatService assumes that these are derived attributes of the objects in table_entries
WTException
public void setDataServiceName(String data_service_name)
public String getDataServiceName()
public void setDataFormatService(DataFormatService new_data_format_service)
public DataFormatService getDataFormatService()
public boolean hasColumn(String columnID)
public void setDefaultColumns(Object[] context_objs, String[] column_names) throws WTException
column_names
- The names of the columns to add
WTException
public void addDefaultColumn(String column_ID, Properties column_properties, Object context_obj) throws WTException
WTException
public void addColumn(Column new_column, Properties properties)
public void deleteColumn(String column_ID) throws WTException
WTException
public void setTableProperties(Properties properties)
public void setColumnProperties(String column_ID, Properties properties) throws WTException
WTException
public void setAllColumnsProperties(Properties properties)
public void setHeaderProperties(String column_ID, Properties properties) throws WTException
WTException
public void setAllHeadersProperties(Properties properties)
public void setHeader(String column_ID, String entry) throws WTException
WTException
public void setDefaultTableProperties()
public void setRowProperties(Properties properties)
public void setDefaultRowProperties()
public void setDefaultColumnProperties(String column_ID)
public void printTable(Object[] table_entries, PrintWriter out)
public void printHeadings(Object[] table_entries, PrintWriter out)
public void setRowFormat()
public void setTableFormat()
public void setColumnFormat()
public void printCaption(PrintWriter out)
public void printRow(Object table_entry, PrintWriter out)
public String[] initColumnNames(Object context_obj) throws WTException
WTException
public void addToVector(Vector columns, Column new_column, Properties properties)
public Object loadClass(String className)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |