org.gudy.azureus2.plugins.ui.tables
Interface TableRow

All Known Subinterfaces:
TableRowCore, TableRowSWT
All Known Implementing Classes:
TableRowPainted, TableRowSWTBase

public interface TableRow

This interface provides access to an Azureus table row.

Since:
2.0.8.5
Author:
TuxPaper

Method Summary
 void addMouseListener(TableRowMouseListener listener)
          Adds a listener that triggers when this TableRow has a mouse event.
 java.lang.Object getData(java.lang.String id)
          Get a previously stored value
 java.lang.Object getDataSource()
          Retrieve the data object associated with the current table row.
 int getIndex()
           
 TableCell getTableCell(java.lang.String sColumnName)
          Retrieve a cell based on its column name
 java.lang.String getTableID()
          Returns which table the row is being displayed in.
 TableView<?> getView()
           
 boolean isSelected()
          Retrieve whether the row is selected by the user
 boolean isValid()
          Validility of the row's cells.
 void removeMouseListener(TableRowMouseListener listener)
          Remove a previously added TableRowMouseListener
 void setData(java.lang.String id, java.lang.Object data)
          Store a value against the table row
 void setForeground(int[] rgb)
          Change the row's foreground color
 void setForeground(int red, int green, int blue)
          Change the row's foreground color.
 void setForegroundToErrorColor()
          Change the row's foreground color to the user's defined "error" color.
 

Method Detail

getDataSource

java.lang.Object getDataSource()
Retrieve the data object associated with the current table row.

Returns:
The return type is dependent upon which table the cell is for:
TABLE_MYTORRENTS_*: Download object for the current row
TABLE_TORRENT_PEERS: Peer object for the current row
TABLE_TORRENT_FILES: DiskManagerFileInfo object for the current row
TABLE_MYTRACKER: TrackerTorrent object for the current row
TABLE_MYSHARES: ShareResource object for the current row
remaining TABLE_* constants: undefined or null

getTableID

java.lang.String getTableID()
Returns which table the row is being displayed in.

Returns:
TableManager.TABLE_* constant

getView

TableView<?> getView()

getIndex

int getIndex()

setForeground

void setForeground(int red,
                   int green,
                   int blue)
Change the row's foreground color.

Parameters:
red - red value (0 - 255)
green - green value (0 - 255)
blue - blue value (0 - 255)
Since:
3.0.3.5

setForeground

void setForeground(int[] rgb)
Change the row's foreground color

Parameters:
rgb - int array of red, green, and blue values. Null to reset to default color
Since:
3.0.4.3

setForegroundToErrorColor

void setForegroundToErrorColor()
Change the row's foreground color to the user's defined "error" color.

Since:
3.0.3.5

isValid

boolean isValid()
Validility of the row's cells.

Returns:
True - Text is the same as last call. You do not need to update unless you have new text to display.
False - Cell-to-Datasource link has changed, and the text is definitely not valid.

getTableCell

TableCell getTableCell(java.lang.String sColumnName)
Retrieve a cell based on its column name

Parameters:
sColumnName - Name/ID of column
Returns:
TableCell object related to this row and the column specified

isSelected

boolean isSelected()
Retrieve whether the row is selected by the user

Returns:
selection status

addMouseListener

void addMouseListener(TableRowMouseListener listener)
Adds a listener that triggers when this TableRow has a mouse event.

Parameters:
listener -
Since:
3.0.1.7

removeMouseListener

void removeMouseListener(TableRowMouseListener listener)
Remove a previously added TableRowMouseListener

Parameters:
listener - Previously added listener
Since:
3.0.1.7

getData

java.lang.Object getData(java.lang.String id)
Get a previously stored value

Parameters:
id -
Returns:
Since:
4.3.1.5

setData

void setData(java.lang.String id,
             java.lang.Object data)
Store a value against the table row

Parameters:
id -
data -
Since:
4.3.1.5