wt.clients.lifecycle.administrator
Class ProcessTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended bywt.clients.lifecycle.administrator.ProcessTableModel
All Implemented Interfaces:
RefreshListener, Serializable, TableModel

class ProcessTableModel
extends AbstractTableModel
implements RefreshListener


Field Summary
private static int CABINET
           
(package private)  WTContainerRef container
           
private static int CONTEXT
           
private static int ENABLED
           
private static int ICON
           
private static int ICON_BASIC
           
(package private)  IconCache iconCache
           
private static int NAME
           
private static int ROUTING
           
(package private)  Vector templates
           
(package private)  ThreadGroup threadGroup
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
(package private) ProcessTableModel()
          Construct the ProcessTableModel.
(package private) ProcessTableModel(WTContainerRef context)
          Construct the ProcessTableModel for this container passed.
 
Method Summary
protected  void deleteTemplate(LifeCycleTemplate template)
          Deletes the Process Template from the list.
private  String getCabinet(int row)
          Get the cabinet the template is in.
 Class getColumnClass(int col)
          JTable uses this method to determine the default renderer/ editor for each cell.
 int getColumnCount()
          Get the number of columns in the table.
 String getColumnName(int col)
          Get the column name for the specified column.
 WTContainerRef getContext(int row)
          Get the context the template is in.
 String getContextName(int row)
          Get the name of the context the template is in.
private  Boolean getEnabled(int row)
          Get the Enabled state for the specified row.
private  ImageIcon getImageIcon_basic(int row)
          Get the Image Icon for the specified row.
private  ImageIcon getImageIcon(int row)
          Get the Image Icon for the specified row.
 String getMasterOid(LifeCycleTemplate template)
           
private  String getName(int row)
          Get the Name for the specified row.
 String getOrganization(int row)
          Get the organization the template is in.
private  Boolean getRouting(int row)
          Get the Routing state for the specified row.
 int getRowCount()
          Get the number of rows in the table.
private  LifeCycleTemplate getTemplate(int row)
          Get the Process Template for the specified row.
 LifeCycleTemplate getTemplate(String name, String org_name)
          Get the Process Template for the specified name.
 LifeCycleTemplate getTemplate(String name, WTContainerRef context)
          Get the LifeCycle Template for the specified name.
private  Vector getTemplates()
          Get all Process Templates.
 Object getValueAt(int row, int col)
          Returns the value of the specified row and column.
 boolean isCellEditable(int row, int col)
          Don't need to implement this method unless your table's editable.
 void refreshObject(RefreshEvent evt)
          Implements the RefreshListener.
private  void setEnabled(Boolean enabled, int row)
          Set the specified Enabled state for the specified row.
private  void setRouting(Boolean routing, int row)
          Set the specified Enabled state for the specified row.
private  void setTemplate(LifeCycleTemplate template, int row)
          Set the Process Template for the specified row.
 void setValueAt(Object value, int row, int col)
          Set the specified value at the specified row and column.
protected  void updateTemplate(LifeCycleTemplate template)
          Updates the Process Template to the list.
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ICON_BASIC

private static final int ICON_BASIC
See Also:
Constant Field Values

ICON

private static final int ICON
See Also:
Constant Field Values

NAME

private static final int NAME
See Also:
Constant Field Values

CABINET

private static final int CABINET
See Also:
Constant Field Values

ENABLED

private static final int ENABLED
See Also:
Constant Field Values

ROUTING

private static final int ROUTING
See Also:
Constant Field Values

CONTEXT

private static final int CONTEXT
See Also:
Constant Field Values

templates

Vector templates

iconCache

IconCache iconCache

threadGroup

ThreadGroup threadGroup

container

WTContainerRef container
Constructor Detail

ProcessTableModel

ProcessTableModel()
Construct the ProcessTableModel. Saves a reference to the thread group.


ProcessTableModel

ProcessTableModel(WTContainerRef context)
Construct the ProcessTableModel for this container passed. Saves a reference to the thread group.

Method Detail

getColumnCount

public int getColumnCount()
Get the number of columns in the table.

Specified by:
getColumnCount in interface TableModel

getRowCount

public int getRowCount()
Get the number of rows in the table.

Specified by:
getRowCount in interface TableModel

getColumnName

public String getColumnName(int col)
Get the column name for the specified column.

Specified by:
getColumnName in interface TableModel

getValueAt

public Object getValueAt(int row,
                         int col)
Returns the value of the specified row and column.

Specified by:
getValueAt in interface TableModel

getColumnClass

public Class getColumnClass(int col)
JTable uses this method to determine the default renderer/ editor for each cell. If we didn't implement this method, then the last column would contain text ("true"/"false"), rather than a check box.

Specified by:
getColumnClass in interface TableModel

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Don't need to implement this method unless your table's editable.

Specified by:
isCellEditable in interface TableModel

setValueAt

public void setValueAt(Object value,
                       int row,
                       int col)
Set the specified value at the specified row and column.

Specified by:
setValueAt in interface TableModel

getImageIcon_basic

private ImageIcon getImageIcon_basic(int row)
Get the Image Icon for the specified row.


getImageIcon

private ImageIcon getImageIcon(int row)
Get the Image Icon for the specified row.


getName

private String getName(int row)
Get the Name for the specified row.


getEnabled

private Boolean getEnabled(int row)
Get the Enabled state for the specified row.


getRouting

private Boolean getRouting(int row)
Get the Routing state for the specified row.


getCabinet

private String getCabinet(int row)
Get the cabinet the template is in.


getContextName

public String getContextName(int row)
                      throws WTException
Get the name of the context the template is in.

Throws:
WTException

getContext

public WTContainerRef getContext(int row)
                          throws WTException
Get the context the template is in.

Throws:
WTException

getOrganization

public String getOrganization(int row)
                       throws WTException
Get the organization the template is in. Pass through for R7 to getContext.

Throws:
WTException

getMasterOid

public String getMasterOid(LifeCycleTemplate template)

setEnabled

private void setEnabled(Boolean enabled,
                        int row)
Set the specified Enabled state for the specified row.


setRouting

private void setRouting(Boolean routing,
                        int row)
Set the specified Enabled state for the specified row.


getTemplate

private LifeCycleTemplate getTemplate(int row)
Get the Process Template for the specified row.


getTemplate

public LifeCycleTemplate getTemplate(String name,
                                     String org_name)
                              throws WTException
Get the Process Template for the specified name.

Throws:
WTException

getTemplate

public LifeCycleTemplate getTemplate(String name,
                                     WTContainerRef context)
                              throws WTException
Get the LifeCycle Template for the specified name.

Throws:
WTException

setTemplate

private void setTemplate(LifeCycleTemplate template,
                         int row)
Set the Process Template for the specified row.


updateTemplate

protected void updateTemplate(LifeCycleTemplate template)
Updates the Process Template to the list. If the template doesn't exist in the list, it is added.


deleteTemplate

protected void deleteTemplate(LifeCycleTemplate template)
Deletes the Process Template from the list.


getTemplates

private Vector getTemplates()
Get all Process Templates.


refreshObject

public void refreshObject(RefreshEvent evt)
Implements the RefreshListener.

Specified by:
refreshObject in interface RefreshListener
Parameters:
evt - the referesh event.
See Also:
RefreshEvent