uk.apl.jxc.tools
Class XMLFilterTableModel

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

public class XMLFilterTableModel
extends javax.swing.table.DefaultTableModel

TableModel representation of an XMLFilter 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
XMLFilterTableModel()
          Constructs a new XMLFilterTableModel.
 
Method Summary
 void applyCriteria(java.util.Iterator<XMLFilterCriteria> iterator)
          Restores saved filter criteria from a criteria iterator.
 boolean isCellEditable(int row, int col)
          Returns true if a cell is editable, false otherwise.
 void setSchema(XMLSchema schema)
          Sets the XML schema to which the filter applies.
 void storeFilter(java.io.File filterFile)
          Saves the filter in a properties file.
 XMLFilter toFilter()
          Returns the table model contents as an XMLFilter.
 
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

XMLFilterTableModel

public XMLFilterTableModel()
Constructs a new XMLFilterTableModel.

Method Detail

setSchema

public void setSchema(XMLSchema schema)
Sets the XML schema to which the filter applies.

Parameters:
schema - XMLSchema the filter applies to

applyCriteria

public void applyCriteria(java.util.Iterator<XMLFilterCriteria> iterator)
                   throws java.io.FileNotFoundException,
                          java.io.IOException
Restores saved filter criteria from a criteria iterator.

Parameters:
iterator - the iterator to apply the criteria from
Throws:
java.io.FileNotFoundException
java.io.IOException

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

toFilter

public XMLFilter toFilter()
Returns the table model contents as an XMLFilter.

Returns:
XMLFilter of the table models content

storeFilter

public void storeFilter(java.io.File filterFile)
                 throws java.io.FileNotFoundException,
                        java.io.IOException
Saves the filter in a properties file.

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


Copyright 2010 Andrew Leigh. All Rights Reserved.