uk.apl.jxc.tools
Class XMLMapperTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by javax.swing.table.DefaultTableModel
          extended by uk.apl.jxc.tools.XMLMapperTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class XMLMapperTableModel
extends javax.swing.table.DefaultTableModel

TableModel representation of an XMLMapper configuration.

Author:
Andrew
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
XMLMapperTableModel()
          Constructs a new XMLMapperTableModel
 
Method Summary
 void applyMappings(java.util.Iterator<AbstractXMLMapping> iterator)
          Restores saved mapping values from a mapping iterator.
 boolean isCellEditable(int row, int col)
          Returns true if a cell is editable, false otherwise.
 void setSourceSchema(XMLSchema schema, java.lang.String rootElement)
          Sets the source XML schema to which the mapping applies.
 void setTargetRootElement(java.lang.String targetRootElement)
          Sets the root element of the target schema.
 void storeMapping(java.io.File mappingFile)
          Saves the mapping in a properties file.
 XMLMapper toMapper()
          Returns the table model contents as an XMLMapper.
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLMapperTableModel

public XMLMapperTableModel()
Constructs a new XMLMapperTableModel

Method Detail

setSourceSchema

public void setSourceSchema(XMLSchema schema,
                            java.lang.String rootElement)
Sets the source XML schema to which the mapping applies.

Parameters:
schema - source XML Schema the mapping applies to

setTargetRootElement

public void setTargetRootElement(java.lang.String targetRootElement)
Sets the root element of the target schema.

Parameters:
targetRootElement - root element of the target schema

applyMappings

public void applyMappings(java.util.Iterator<AbstractXMLMapping> iterator)
Restores saved mapping values from a mapping iterator.

Parameters:
iterator - the iterator to apply the mappings from

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Returns true if a cell is editable, false otherwise.

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.DefaultTableModel
Parameters:
row - the cells row
col - the cells column
Returns:
true if the cell is editable

toMapper

public XMLMapper toMapper()
Returns the table model contents as an XMLMapper.

Returns:
XMLMapper of the table models content

storeMapping

public void storeMapping(java.io.File mappingFile)
                  throws java.io.FileNotFoundException,
                         java.io.IOException
Saves the mapping in a properties file.

Parameters:
mappingFile - the file to save the filter to
Throws:
java.io.FileNotFoundException
java.io.IOException


Copyright 2010 Andrew Leigh. All Rights Reserved.