|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TableCell
This interface provides access to an Azureus table cell.
TableManager
Method Summary | |
---|---|
void |
addDisposeListener(TableCellDisposeListener listener)
Adds a listener that triggers when the TableCell has been disposed |
void |
addListeners(Object listenerObject)
A listener is added for every type of cell listener the supplied object implements |
void |
addMouseListener(TableCellMouseListener listener)
Adds a listener that triggers when a TableCell that belongs to this column has a mouse event. |
void |
addRefreshListener(TableCellRefreshListener listener)
Adds a listener that triggers when the TableCell needs refreshing |
void |
addToolTipListener(TableCellToolTipListener listener)
Adds a listener related to tooltip actions |
int[] |
getBackground()
Get the background color of the cell |
Graphic |
getBackgroundGraphic()
Returns a Graphic of what's behind the cell |
String |
getClipboardText()
Returns text that's meant for the clipboard |
Object |
getDataSource()
Retrieve the data object associated with the current table row and cell. |
int[] |
getForeground()
Get the foreground color of the cell |
Graphic |
getGraphic()
Retrieve the SWT graphic related to this table item for TableColumn objects of TYPE_GRAPHIC only. |
int |
getHeight()
Retrieve the height of the cell's drawing area (excluding any margin) for TableColumn objects of TYPE_GRAPHIC only. |
int |
getMarginHeight()
|
int |
getMarginWidth()
|
int |
getMaxLines()
Retrieves the number of lines available for setting text |
int[] |
getMouseOffset()
Return the position of the mouse relative to the cell. |
Comparable |
getSortValue()
Retrieves the sorting value |
TableColumn |
getTableColumn()
Retreive the TableColumn that this cell belongs to |
String |
getTableID()
Returns which table the cell is being displayed in. |
TableRow |
getTableRow()
Retrieve the TableRow that this cell belongs to |
String |
getText()
Retrieve the Cell's text |
Object |
getToolTip()
Retrieve the tooltip object assigned to this cell |
int |
getWidth()
Retrieve the width of the cell's drawing area (excluding any margin) for TableColumn objects of TYPE_GRAPHIC only. |
void |
invalidate()
Sets the cell to invalid. |
boolean |
isDisposed()
Retrieve whether the cell has been disposed. |
boolean |
isShown()
Determines if the user has chosen to display the cell |
boolean |
isValid()
Validility of the cell's text. |
void |
removeDisposeListener(TableCellDisposeListener listener)
Remove a previously added TableCellDisposeListener |
void |
removeMouseListener(TableCellMouseListener listener)
Remove a previously added TableCellMouseListener |
void |
removeRefreshListener(TableCellRefreshListener listener)
Remove a previously added TableCellRefreshListener |
void |
removeToolTipListener(TableCellToolTipListener listener)
Remove a previously added TableCellToolTipListener |
void |
setFillCell(boolean bFillCell)
Sets whether the graphic fills the whole cell for TableColumn objects of TYPE_GRAPHIC only. |
boolean |
setForeground(int[] rgb)
Change the cell's foreground color |
boolean |
setForeground(int red,
int green,
int blue)
Change the cell's foreground color. |
boolean |
setForegroundToErrorColor()
Change the cell's foreground color to the user's defined "error" color. |
boolean |
setGraphic(Graphic img)
Sets the image to be drawn. |
void |
setMarginHeight(int height)
Specifies the number of pixels of vertical margin that will be placed along the top and bottom edges of the layout for TableColumn objects of TYPE_GRAPHIC only. |
void |
setMarginWidth(int width)
Specifies the number of pixels of horizontal margin that will be placed along the left and right edges of the layout for TableColumn object of TYPE_GRAPHIC only. |
boolean |
setSortValue(Comparable valueToSort)
Sets a Comparable object that column sorting will act on. |
boolean |
setSortValue(float valueToSort)
Sets a float value that the column sorting will act upon. |
boolean |
setSortValue(long valueToSort)
Sets a long value that the column sorting will act on. |
boolean |
setText(String text)
This method is called to set the cell's text. |
void |
setToolTip(Object tooltip)
Set the cell's tooltip display. |
Method Detail |
---|
Object getDataSource()
Download
object for the current rowPeer
object for the current rowDiskManagerFileInfo
object for the current rowTrackerTorrent
object for the current rowShareResource
object for the current rowTableColumn getTableColumn()
TableRow getTableRow()
String getTableID()
TableManager
.TABLE_* constantboolean setText(String text)
This function must be called from the same thread that the GUI is running
under. Listeners like TableCellAddedListener
do not always get
called on the GUI thread.
If you wish to set the text and not worry about changing to the GUI thread,
use invalidate()
, and set the text in the
TableCellRefreshListener
text
- the text to be set
String getText()
boolean setForeground(int red, int green, int blue)
pass -1 to return color back to default
red
- red value (0 - 255)green
- green value (0 - 255)blue
- blue value (0 - 255)
boolean setForeground(int[] rgb)
rgb
- int array containing red, green, and blue values, respectively.
null to return color back to default
boolean setForegroundToErrorColor()
int[] getForeground()
int[] getBackground()
boolean setSortValue(Comparable valueToSort)
valueToSort
- the object that will be used when the column cell's
are compared to each other
boolean setSortValue(long valueToSort)
valueToSort
- sorting value.
boolean setSortValue(float valueToSort)
valueToSort
- float sort value
Comparable getSortValue()
boolean isShown()
boolean isValid()
void invalidate()
void setToolTip(Object tooltip)
tooltip
- Object to display. Currently, only String is supportedaddToolTipListener(TableCellToolTipListener)
Object getToolTip()
addToolTipListener(TableCellToolTipListener)
boolean isDisposed()
TableCellDisposeListener
is triggered.
int getMaxLines()
int getWidth()
int getHeight()
boolean setGraphic(Graphic img)
From 3.0.1.1, setting the graphic to the same Graphic object will not
redraw the image. You need to invalidate()
the cell if you
know the image bits have changed (or you could pass a new Graphic object
in each time a new image is generated)
Previously, setting the graphic to the same object resulted in a repaint. Plugins were naughty and would do this on every refresh, causing horrible repaint slowdowns.
img
- image to be stored & drawn
Graphic getGraphic()
void setFillCell(boolean bFillCell)
bFillCell
- true - the whole cell is filled by the graphicint getMarginHeight()
void setMarginHeight(int height)
The default is 1.
height
- new margin heightint getMarginWidth()
void setMarginWidth(int width)
The default is 1.
width
- new margin widthvoid addRefreshListener(TableCellRefreshListener listener)
listener
- Listener Object to be called when refresh is needed.void removeRefreshListener(TableCellRefreshListener listener)
listener
- Previously added listenervoid addDisposeListener(TableCellDisposeListener listener)
listener
- listener object to be calledvoid removeDisposeListener(TableCellDisposeListener listener)
listener
- Previously added listenervoid addToolTipListener(TableCellToolTipListener listener)
listener
- listener object to be calledvoid removeToolTipListener(TableCellToolTipListener listener)
listener
- Previously added listenervoid addMouseListener(TableCellMouseListener listener)
listener
- void removeMouseListener(TableCellMouseListener listener)
listener
- Previously added listenervoid addListeners(Object listenerObject)
listenerObject
- Object implementing some cell listenetersGraphic getBackgroundGraphic()
int[] getMouseOffset()
String getClipboardText()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |