Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.plugin.keybindingchooser.globalchooser
Class GlobalShortcutTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by net.java.sip.communicator.plugin.keybindingchooser.globalchooser.GlobalShortcutTableModel
All Implemented Interfaces:
Serializable, TableModel

public class GlobalShortcutTableModel
extends AbstractTableModel

Table model for global shortcuts.

Author:
Sebastien Vincent
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
GlobalShortcutTableModel()
           
 
Method Summary
 void addEntry(GlobalShortcutEntry entry)
          Adds an entry.
 Class<?> getColumnClass(int columnIndex)
          Overrides a method that always returned Object.class Now it will return Boolean.class for the first method, letting the DefaultTableCellRenderer create checkboxes.
 int getColumnCount()
          Returns the number of column in the table
 String getColumnName(int column)
          Returns the title for this column
 List<GlobalShortcutEntry> getEntries()
          Returns all shortcuts.
 GlobalShortcutEntry getEntryAt(int row)
          Returns the LdapDirectory at the row 'row'
 int getRowCount()
          Returns the number of rows in the table
 Object getValueAt(int row, int column)
          Returns the text for the given cell of the table
 boolean isCellEditable(int row, int col)
          Returns whether a cell is editable.
 void removeEntry(GlobalShortcutEntry entry)
          Adds an entry.
 void ssetValueAt(Object aValue, int rowIndex, int columnIndex)
          Sets a value in an editable cell.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobalShortcutTableModel

public GlobalShortcutTableModel()
Method Detail

getColumnName

public String getColumnName(int column)
Returns the title for this column

Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel
Parameters:
column - the column
Returns:
the title for this column
See Also:
AbstractTableModel.getColumnName(int)

getRowCount

public int getRowCount()
Returns the number of rows in the table

Returns:
the number of rows in the table
See Also:
TableModel.getRowCount()

getColumnCount

public int getColumnCount()
Returns the number of column in the table

Returns:
the number of columns in the table
See Also:
TableModel.getColumnCount()

getValueAt

public Object getValueAt(int row,
                         int column)
Returns the text for the given cell of the table

Parameters:
row - cell row
column - cell column
Returns:
object at the row/column
See Also:
TableModel.getValueAt(int, int)

getEntryAt

public GlobalShortcutEntry getEntryAt(int row)
Returns the LdapDirectory at the row 'row'

Parameters:
row - the row on which to find the LdapDirectory
Returns:
the LdapDirectory found

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Returns whether a cell is editable.

Specified by:
isCellEditable in interface TableModel
Overrides:
isCellEditable in class AbstractTableModel
Parameters:
row - row of the cell
col - column of the cell
Returns:
whether the cell is editable

getColumnClass

public Class<?> getColumnClass(int columnIndex)
Overrides a method that always returned Object.class Now it will return Boolean.class for the first method, letting the DefaultTableCellRenderer create checkboxes.

Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel
Parameters:
columnIndex - index of the column
Returns:
Column class

ssetValueAt

public void ssetValueAt(Object aValue,
                        int rowIndex,
                        int columnIndex)
Sets a value in an editable cell.

Parameters:
aValue - value to set
rowIndex - row index
columnIndex - column index

addEntry

public void addEntry(GlobalShortcutEntry entry)
Adds an entry.

Parameters:
entry - entry to add

removeEntry

public void removeEntry(GlobalShortcutEntry entry)
Adds an entry.

Parameters:
entry - entry to add

getEntries

public List<GlobalShortcutEntry> getEntries()
Returns all shortcuts.

Returns:
all shortcuts.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.