de.beamertool.admin.configuration.editor.smiley
Class SmileyTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by de.beamertool.admin.configuration.editor.smiley.SmileyTableModel
All Implemented Interfaces:
Serializable, TableModel

public class SmileyTableModel
extends AbstractTableModel

Model to hold a smiley replacment map, used by beamer-tool.
There are also some convienece methods to handle the data in an easier way.

Author:
ocm-zeeman
See Also:
Serialized Form

Constructor Summary
SmileyTableModel(Map<String,String> newList)
          Constructor used to initalize the table with the given map
 
Method Summary
 void addReplacment(String key, String file)
          Add new table entry for the smiley replacement map.
 Class<?> getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 String getColumnName(int columnIndex)
           
 int getRowCount()
           
 Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 void remoteReplacement(int row)
          Removes the given replacment at row
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmileyTableModel

public SmileyTableModel(Map<String,String> newList)
Constructor used to initalize the table with the given map

Parameters:
newList - Start values for the list
Method Detail

addReplacment

public void addReplacment(String key,
                          String file)
Add new table entry for the smiley replacement map.

Parameters:
key - New key for the replacement
file - New path to the image for the replacment

getColumnClass

public Class<?> getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel

getColumnCount

public int getColumnCount()

getColumnName

public String getColumnName(int columnIndex)
Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel

getRowCount

public int getRowCount()

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface TableModel
Overrides:
isCellEditable in class AbstractTableModel

remoteReplacement

public void remoteReplacement(int row)
Removes the given replacment at row

Parameters:
row - The row which shouuld be removed

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class AbstractTableModel