edu.wisc.ssec.mcidasv.servermanager
Class TabbedAddeManager.RemoteAddeTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by edu.wisc.ssec.mcidasv.servermanager.TabbedAddeManager.RemoteAddeTableModel
All Implemented Interfaces:
Serializable, TableModel
Enclosing class:
TabbedAddeManager

private static class TabbedAddeManager.RemoteAddeTableModel
extends AbstractTableModel


Field Summary
private static int ACCT
           
private  String[] columnNames
          Labels that appear as the column headers.
private static int DATASET
           
private static Pattern ENTRY_ID_SPLITTER
           
private  EntryStore entryStore
          EntryStore used to query and apply changes.
private  List<String> servers
           
private static int SOURCE
           
private static int TYPES
           
private static int VALID
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
TabbedAddeManager.RemoteAddeTableModel(EntryStore entryStore)
          Builds an AbstractTableModel with some extensions that facilitate working with RemoteAddeEntrys.
 
Method Summary
private static String formattedAccounting(String serv, EntryStore manager)
           
private static String formattedSource(String serv, EntryStore manager)
           
private static String formattedTypes(String serv, EntryStore manager)
           
private static String formattedValidity(String serv, EntryStore manager)
           
 Class<?> getColumnClass(int column)
           
 int getColumnCount()
          Returns the length of columnNames.
 String getColumnName(int column)
          Returns the column name associated with column.
protected  List<RemoteAddeEntry> getEntriesAtRow(int row)
          Returns the RemoteAddeEntry at the given index.
 int getRowCount()
          Returns the number of entries being managed.
protected  int getRowForEntry(RemoteAddeEntry entry)
          Returns the index of the given entry.
protected  int getRowForEntry(String entryText)
          Returns the index of the given entry text within the table.
 Object getValueAt(int row, int column)
          Finds the value at the given coordinates.
private static boolean hasType(String serv, EntryStore manager, AddeEntry.EntryType type)
           
 boolean isCellEditable(int row, int column)
           
 void refreshEntries()
          Clears and re-adds all RemoteAddeEntrys within entryStore.
 
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
 

Field Detail

VALID

private static final int VALID
See Also:
Constant Field Values

SOURCE

private static final int SOURCE
See Also:
Constant Field Values

DATASET

private static final int DATASET
See Also:
Constant Field Values

ACCT

private static final int ACCT
See Also:
Constant Field Values

TYPES

private static final int TYPES
See Also:
Constant Field Values

ENTRY_ID_SPLITTER

private static final Pattern ENTRY_ID_SPLITTER

columnNames

private final String[] columnNames
Labels that appear as the column headers.


servers

private final List<String> servers

entryStore

private final EntryStore entryStore
EntryStore used to query and apply changes.

Constructor Detail

TabbedAddeManager.RemoteAddeTableModel

public TabbedAddeManager.RemoteAddeTableModel(EntryStore entryStore)
Builds an AbstractTableModel with some extensions that facilitate working with RemoteAddeEntrys.

Parameters:
entryStore - Server manager object.
Method Detail

getEntriesAtRow

protected List<RemoteAddeEntry> getEntriesAtRow(int row)
Returns the RemoteAddeEntry at the given index.

Parameters:
row - Index of the entry.
Returns:
The RemoteAddeEntry at the index specified by row.

getRowForEntry

protected int getRowForEntry(RemoteAddeEntry entry)
Returns the index of the given entry.

Parameters:
entry - RemoteAddeEntry whose row is desired.
Returns:
Index of the desired entry, or -1 if the entry wasn't found.

getRowForEntry

protected int getRowForEntry(String entryText)
Returns the index of the given entry text within the table.

Parameters:
entryText - String representation of the desired entry.
Returns:
Index of the desired entry, or -1 if the entry was not found.
See Also:
AddeEntry.getEntryText()

refreshEntries

public void refreshEntries()
Clears and re-adds all RemoteAddeEntrys within entryStore.


getColumnCount

public int getColumnCount()
Returns the length of columnNames.

Returns:
The number of columns.

getRowCount

public int getRowCount()
Returns the number of entries being managed.


getValueAt

public Object getValueAt(int row,
                         int column)
Finds the value at the given coordinates.

Parameters:
row - Table row.
column - Table column.
Returns:
Value stored at the given row and column coordinates
Throws:
IndexOutOfBoundsException - if row or column refer to an invalid table cell.

formattedSource

private static String formattedSource(String serv,
                                      EntryStore manager)

formattedValidity

private static String formattedValidity(String serv,
                                        EntryStore manager)

formattedAccounting

private static String formattedAccounting(String serv,
                                          EntryStore manager)

hasType

private static boolean hasType(String serv,
                               EntryStore manager,
                               AddeEntry.EntryType type)

formattedTypes

private static String formattedTypes(String serv,
                                     EntryStore manager)

getColumnName

public String getColumnName(int column)
Returns the column name associated with column.

Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel
Returns:
One of columnNames.

getColumnClass

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

isCellEditable

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