Ontimize 5.2072EN

com.ontimize.gui.table
Class TableConfigurationManager

java.lang.Object
  extended bycom.ontimize.gui.table.TableConfigurationManager

public class TableConfigurationManager
extends java.lang.Object

Class that manages renderers and editors for component Table when these ones are defined in an external file (complete path to this file must be established with variable Table.rendererEditorConfigurationFile). Structure of this file should be similar to:

<?xml version="1.0" encoding="UTF-8"?>

<TableConfiguration>

 <TableRenderers>
   <com.ontimize.gui.table.BooleanCellRenderer rendererid="boolean" />
   <com.ontimize.gui.table.BundleCellRenderer rendererid="bundle" />
   <com.ontimize.gui.table.CurrencyCellRenderer rendererid="currency" />
   <com.ontimize.gui.table.DateCellRenderer rendererid="date" />
   <com.ontimize.gui.table.MemoCellRenderer rendererid="memo" />
   <com.ontimize.gui.table.PercentCellRenderer rendererid="percent" />
   <com.ontimize.gui.table.RealCellRenderer rendererid="real" />
 </TableRenderers>

 <TableEditors>
   <com.ontimize.gui.table.BooleanCellEditor editorid="boolean" />
 </TableEditors>

</TableConfiguration>

Since:
5.2058EN
Author:
Imatia Innovation SL

Nested Class Summary
static class TableConfigurationManager.TableElementConfig
          Internal class for creating objects that manage identifier, class name and parameters for each element.
 
Field Summary
protected  java.util.Hashtable editorsConfig
           
protected  java.util.Hashtable renderersConfig
           
protected static TableConfigurationManager tableConfigurationManager
           
 
Constructor Summary
TableConfigurationManager()
           
TableConfigurationManager(java.io.InputStream inputStream)
           
TableConfigurationManager(java.lang.String filePath)
           
 
Method Summary
 void addElements(java.lang.String xmlDefinition)
           
protected  void configure(java.io.InputStream inputStream)
          Parses TableRenderers and TableEditors.
protected  void configureEditors(org.w3c.dom.NodeList nodeList)
          Method called internally by configure(InputStream) in order to parse editors.
protected  void configureRenderers(org.w3c.dom.NodeList nodeList)
          Method called internally by configure(InputStream) in order to parse renderers.
 javax.swing.table.TableCellEditor getCellEditor(java.lang.String id, java.lang.String columnName)
           
 javax.swing.table.TableCellRenderer getCellRenderer(java.lang.Object id)
           
protected  TableConfigurationManager.TableElementConfig getElement(java.lang.Object id, org.w3c.dom.Node item)
           
static TableConfigurationManager getTableConfigurationManager(java.lang.String filePath, boolean create)
          This method is called from Table with file path parameter.
static void setTableConfigurationManager(TableConfigurationManager manager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

renderersConfig

protected java.util.Hashtable renderersConfig

editorsConfig

protected java.util.Hashtable editorsConfig

tableConfigurationManager

protected static TableConfigurationManager tableConfigurationManager
Constructor Detail

TableConfigurationManager

public TableConfigurationManager(java.io.InputStream inputStream)
                          throws java.lang.Exception

TableConfigurationManager

public TableConfigurationManager()

TableConfigurationManager

public TableConfigurationManager(java.lang.String filePath)
                          throws java.lang.Exception
Method Detail

getTableConfigurationManager

public static TableConfigurationManager getTableConfigurationManager(java.lang.String filePath,
                                                                     boolean create)
This method is called from Table with file path parameter. It is a singleton and all Table objects share the same instance.

Parameters:
filePath - Complete path to file.
create - Condition to create or not the object when not exists.
Returns:
An instance of this class.

setTableConfigurationManager

public static void setTableConfigurationManager(TableConfigurationManager manager)

configure

protected void configure(java.io.InputStream inputStream)
                  throws java.lang.Exception
Parses TableRenderers and TableEditors.

Parameters:
inputStream - Input stream
Throws:
java.lang.Exception - When occurs an exception parsing

addElements

public void addElements(java.lang.String xmlDefinition)
                 throws java.lang.Exception
Throws:
java.lang.Exception

configureRenderers

protected void configureRenderers(org.w3c.dom.NodeList nodeList)
Method called internally by configure(InputStream) in order to parse renderers.

Throws:
java.lang.Exception - When occurs an exception parsing

configureEditors

protected void configureEditors(org.w3c.dom.NodeList nodeList)
Method called internally by configure(InputStream) in order to parse editors.

Throws:
java.lang.Exception - When occurs an exception parsing

getElement

protected TableConfigurationManager.TableElementConfig getElement(java.lang.Object id,
                                                                  org.w3c.dom.Node item)

getCellRenderer

public javax.swing.table.TableCellRenderer getCellRenderer(java.lang.Object id)

getCellEditor

public javax.swing.table.TableCellEditor getCellEditor(java.lang.String id,
                                                       java.lang.String columnName)

Ontimize