Project: stp

com.ibm.rational.stp.client.samples
Class BrowserDataModel

Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.ibm.rational.stp.client.samples.BrowserDataModel
All Implemented Interfaces:
Serializable, javax.swing.table.TableModel

public abstract class BrowserDataModel
extends javax.swing.table.AbstractTableModel

An all-in-one class for displaying a table of browser data

See Also:
Serialized Form

Nested Class Summary
(package private) static interface BrowserDataModel.Operations
          A specification for the interface between the BrowserDataModel and a provider of operations to be applied to the object displayed in the model.
 
Field Summary
(package private) static int lastX
          The X offset for the next window displayed
(package private) static int lastY
          The Y offset for the next window displayed
protected  javax.swing.JFrame m_frame
          The frame containing this data model
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
BrowserDataModel()
           
 
Method Summary
(package private)  BrowserDataModel.Operations getOperationsObject()
           
(package private) abstract  Object getViewable(int index)
          Returns the object that is viewable at a given index in the table model
(package private)  void redisplay()
          Rereads the data from the resource and redisplays it
(package private)  int[] selectedRows(javax.swing.JTable table)
          Returns the rows of the table currently selected in the display
(package private) abstract  void show(Object viewable)
          Displays an object returned by getViewable
(package private)  void showContent()
          Displays the content of the object whose properties are displayed in this table.
(package private) static javax.swing.JFrame showFile(String title, File file)
          Displays the content of file in a window.
(package private)  javax.swing.JFrame showModel(String title, boolean hasContent)
          Generates a display of this table.
(package private)  void toggleErrors()
          Processes the Show/Hide Errors button when clicked.
(package private)  String toggleErrorsLabel()
          Returns the label to place on the Hide/Show Errors button
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.table.TableModel
getColumnCount, getRowCount, getValueAt
 

Field Detail

m_frame

protected javax.swing.JFrame m_frame
The frame containing this data model


lastX

static int lastX
The X offset for the next window displayed


lastY

static int lastY
The Y offset for the next window displayed

Constructor Detail

BrowserDataModel

public BrowserDataModel()
Method Detail

getViewable

abstract Object getViewable(int index)
Returns the object that is viewable at a given index in the table model

Parameters:
index - The index into the table model of the item to show
Returns:
null if the item is not viewable; otherwise an object that is viewable.

show

abstract void show(Object viewable)
            throws javax.wvcm.WvcmException
Displays an object returned by getViewable

Parameters:
viewable - The object to display.
Throws:
javax.wvcm.WvcmException

showContent

void showContent()
           throws Throwable
Displays the content of the object whose properties are displayed in this table.

Throws:
Throwable - If the content cannot be displayed.

toggleErrorsLabel

String toggleErrorsLabel()
Returns the label to place on the Hide/Show Errors button

Returns:
If null or empty, the Hide/Show button is not displayed; otherwise the button will be displayed with the given label.

redisplay

void redisplay()
         throws javax.wvcm.WvcmException
Rereads the data from the resource and redisplays it

Throws:
javax.wvcm.WvcmException - If problems arise during the process.

toggleErrors

void toggleErrors()
            throws javax.wvcm.WvcmException
Processes the Show/Hide Errors button when clicked.

Throws:
javax.wvcm.WvcmException - if the action cannot be carried out.

getOperationsObject

BrowserDataModel.Operations getOperationsObject()

showModel

javax.swing.JFrame showModel(String title,
                             boolean hasContent)
Generates a display of this table.

Parameters:
title - The window title
hasContent - true if the ShowContent button should be displayed

selectedRows

int[] selectedRows(javax.swing.JTable table)
Returns the rows of the table currently selected in the display

Parameters:
table - The table
Returns:
An int[] containing the index of each row that is highlighted

showFile

static javax.swing.JFrame showFile(String title,
                                   File file)
                            throws Throwable
Displays the content of file in a window.

Parameters:
title - The title string to appear in the window banner
file - A File identifying the file whose content is to be displayed
Returns:
A JFrame for the displayed window.
Throws:
Throwable - If the content of the file cannot be displayed.

Generated Fri 18-Apr-2014 01:42 PM

Copyright © IBM 2014. All rights reserved.