Class FakeTableCell
- java.lang.Object
-
- com.biglybt.ui.swt.views.table.impl.FakeTableCell
-
- All Implemented Interfaces:
TableCell
,TableCellCore
,TableCellSWT
,java.lang.Comparable
,java.util.EventListener
,org.eclipse.swt.events.MouseListener
,org.eclipse.swt.events.MouseMoveListener
,org.eclipse.swt.events.MouseTrackListener
,org.eclipse.swt.events.PaintListener
,org.eclipse.swt.internal.SWTEventListener
public class FakeTableCell extends java.lang.Object implements TableCellSWT, org.eclipse.swt.events.PaintListener, org.eclipse.swt.events.MouseListener, org.eclipse.swt.events.MouseMoveListener, org.eclipse.swt.events.MouseTrackListener
-
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.swt.graphics.Rectangle
cellArea
private java.util.ArrayList<TableCellClipboardListener>
cellClipboardListeners
private java.util.ArrayList
cellMouseListeners
private java.util.ArrayList
cellMouseMoveListeners
private java.util.ArrayList
cellSWTPaintListeners
private java.util.ArrayList
cellVisibilityListeners
private org.eclipse.swt.widgets.Composite
composite
private java.lang.Object
coreDataSource
private java.lang.Object
default_tooltip
private java.util.ArrayList
disposeListeners
private TableRow
fakeRow
private Graphic
graphic
private boolean
hadMore
private org.eclipse.swt.graphics.Image
image
private org.eclipse.swt.graphics.Rectangle
imageBounds
private int
marginHeight
private int
marginWidth
private int
orientation
private java.lang.Object
pluginDataSource
private java.util.ArrayList
refreshListeners
private java.lang.Comparable
sortValue
private TableColumnCore
tableColumn
private java.lang.String
text
private AEMonitor
this_mon
private java.lang.Object
tooltip
private java.util.ArrayList
tooltipListeners
private java.util.Map<java.lang.Object,java.lang.Object>
userData
private boolean
valid
private boolean
wrapText
-
Fields inherited from interface com.biglybt.ui.common.table.TableCellCore
TOOLTIPLISTENER_HOVER, TOOLTIPLISTENER_HOVERCOMPLETE
-
-
Constructor Summary
Constructors Constructor Description FakeTableCell(TableColumn column, java.lang.Object ds)
FakeTableCell(TableColumnCore column, java.lang.Object ds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
_setSortValue(java.lang.Comparable valueToSort)
private void
addCellClipboardListener(TableCellClipboardListener listener)
void
addDisposeListener(TableCellDisposeListener listener)
Adds a listener that triggers when the TableCell has been disposedvoid
addListeners(java.lang.Object listenerObject)
A listener is added for every type of cell listener the supplied object implementsvoid
addMouseListener(TableCellMouseListener listener)
Adds a listener that triggers when a TableCell that belongs to this column has a mouse event.void
addMouseMoveListener(TableCellMouseMoveListener listener)
void
addRefreshListener(TableCellRefreshListener listener)
Adds a listener that triggers when the TableCell needs refreshingprivate void
addSWTPaintListener(TableCellSWTPaintListener listener)
void
addToolTipListener(TableCellToolTipListener listener)
Adds a listener related to tooltip actionsvoid
addVisibilityListener(TableCellVisibilityListener listener)
protected TableCellMouseEvent
buildMouseEvent(org.eclipse.swt.events.MouseEvent e, int eventType)
int
compareTo(java.lang.Object arg0)
void
dispose()
dispose of the cellvoid
doPaint(org.eclipse.swt.graphics.GC gc)
Paint the cell (for graphics)void
doPaint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)
int[]
getBackground()
Get the background color of the cellGraphic
getBackgroundGraphic()
Returns a Graphic of what's behind the cellorg.eclipse.swt.graphics.Image
getBackgroundImage()
org.eclipse.swt.graphics.Color
getBackgroundSWT()
org.eclipse.swt.graphics.Rectangle
getBounds()
org.eclipse.swt.graphics.Rectangle
getBoundsOnDisplay()
org.eclipse.swt.graphics.Rectangle
getCellArea()
java.lang.String
getClipboardText()
Returns text that's meant for the clipboardint
getCursorID()
Get the cursor ID we are currently using XXX Should NOT be SWT.CURSOR_ constants!java.lang.Object
getData(java.lang.Object key)
java.lang.Object
getDataSource()
Retrieve the data object associated with the current table row and cell.java.lang.Object
getDefaultToolTip()
int[]
getForeground()
Get the foreground color of the cellorg.eclipse.swt.graphics.Color
getForegroundSWT()
Graphic
getGraphic()
Retrieve the SWT graphic related to this table item for TableColumn objects of TYPE_GRAPHIC only.org.eclipse.swt.graphics.Image
getGraphicSWT()
int
getHeight()
Retrieve the height of the cell's drawing area (excluding any margin) for TableColumn objects of TYPE_GRAPHIC only.org.eclipse.swt.graphics.Image
getIcon()
int
getMarginHeight()
int
getMarginWidth()
int
getMaxLines()
Retrieves the number of lines available for setting textint[]
getMouseOffset()
Return the position of the mouse relative to the cell.java.lang.String
getObfuscatedText()
Return the text used when generating diagnosticsorg.eclipse.swt.graphics.Point
getSize()
java.lang.Comparable
getSortValue()
Retrieves the sorting valueTableColumn
getTableColumn()
Retreive the TableColumn that this cell belongs toTableColumnCore
getTableColumnCore()
java.lang.String
getTableID()
Returns which table the cell is being displayed in.TableRow
getTableRow()
Retrieve the TableRow that this cell belongs toTableRowCore
getTableRowCore()
Retrieve the row that this cell belongs toTableRowSWT
getTableRowSWT()
java.lang.String
getText()
Retrieve the Cell's textint
getTextAlpha()
java.lang.Object
getToolTip()
Retrieve the tooltip object assigned to this cellboolean
getVisuallyChangedSinceRefresh()
Returns whether the cell has visually changed since the last refresh call.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.void
invalidate(boolean mustRefresh)
void
invokeMouseListeners(TableCellMouseEvent event)
Trigger all the mouse listeners that have been addded to this cellvoid
invokeSWTPaintListeners(org.eclipse.swt.graphics.GC gc)
void
invokeToolTipListeners(int type)
Trigger all the tooltip listeners that have been added to this cellvoid
invokeVisibilityListeners(int visibility, boolean invokeColumnListeners)
Trigger all the visibility listeners that have been added to this cell.boolean
isDisposed()
Retrieve whether the cell has been disposed.boolean
isMouseOver()
boolean
isShown()
Determines if the user has chosen to display the cellboolean
isUpToDate()
Returns whether the cell will need updating when it's visible againboolean
isValid()
Validility of the cell's text.void
locationChanged()
Location of the cell has changedvoid
mouseDoubleClick(org.eclipse.swt.events.MouseEvent e)
void
mouseDown(org.eclipse.swt.events.MouseEvent e)
void
mouseEnter(org.eclipse.swt.events.MouseEvent e)
void
mouseExit(org.eclipse.swt.events.MouseEvent e)
void
mouseHover(org.eclipse.swt.events.MouseEvent e)
void
mouseMove(org.eclipse.swt.events.MouseEvent e)
void
mouseUp(org.eclipse.swt.events.MouseEvent e)
boolean
needsPainting()
Retrieve whether the cell need any paint calls (graphic)void
paintControl(org.eclipse.swt.events.PaintEvent e)
void
redraw()
boolean
refresh()
Refresh the cell, including graphic typesboolean
refresh(boolean doGraphics)
Refresh the cellboolean
refresh(boolean doGraphics, boolean rowVisible)
Refresh the cell.boolean
refresh(boolean doGraphics, boolean rowVisible, boolean cellVisible)
Refresh the cell.void
refreshAsync()
void
removeDisposeListener(TableCellDisposeListener listener)
Remove a previously added TableCellDisposeListenervoid
removeMouseListener(TableCellMouseListener listener)
Remove a previously added TableCellMouseListenervoid
removeMouseMoveListener(TableCellMouseMoveListener listener)
void
removeRefreshListener(TableCellRefreshListener listener)
Remove a previously added TableCellRefreshListenervoid
removeToolTipListener(TableCellToolTipListener listener)
Remove a previously added TableCellToolTipListenervoid
removeVisibilityListener(TableCellVisibilityListener listener)
void
setCellArea(org.eclipse.swt.graphics.Rectangle cellArea)
void
setControl(org.eclipse.swt.widgets.Composite composite)
void
setControl(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.graphics.Rectangle cellArea, boolean addListeners)
boolean
setCursorID(int cursorID)
Set the cursor ID that should be used for the cellvoid
setData(java.lang.Object key, java.lang.Object data)
void
setDataSource(java.lang.Object _coreDataSource)
void
setDefaultToolTip(java.lang.Object o)
Sets tooltip to be shown in absence of an explicit onevoid
setFillCell(boolean fillCell)
Sets whether the graphic fills the whole cell for TableColumn objects of TYPE_GRAPHIC only.boolean
setForeground(int[] rgb)
Change the cell's foreground colorboolean
setForeground(int red, int green, int blue)
Change the cell's foreground color.boolean
setForeground(org.eclipse.swt.graphics.Color color)
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.boolean
setGraphic(org.eclipse.swt.graphics.Image img)
boolean
setIcon(org.eclipse.swt.graphics.Image img)
Set the cell's iconvoid
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.void
setMouseOver(boolean b)
void
setOrentation(int o)
private void
setOrientationViaColumn()
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
setSortValue(java.lang.Comparable valueToSort)
Sets a Comparable object that column sorting will act on.boolean
setText(java.lang.String text)
This method is called to set the cell's text.void
setTextAlpha(int textOpacity)
void
setToolTip(java.lang.Object tooltip)
Set the cell's tooltip display.void
setUpToDate(boolean upToDate)
Sets whether the cell will need updating when it's visible againvoid
setWrapText(boolean wrap)
private void
updateTooltip()
boolean
useSimpleSortValue()
When true, the user is sorting by multiple columns, and you should set the cell's sort value based solely on your column's data.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.biglybt.pif.ui.tables.TableCell
isSecondarySortEnabled
-
-
-
-
Field Detail
-
this_mon
private AEMonitor this_mon
-
refreshListeners
private java.util.ArrayList refreshListeners
-
disposeListeners
private java.util.ArrayList disposeListeners
-
tooltipListeners
private java.util.ArrayList tooltipListeners
-
cellMouseListeners
private java.util.ArrayList cellMouseListeners
-
cellMouseMoveListeners
private java.util.ArrayList cellMouseMoveListeners
-
cellVisibilityListeners
private java.util.ArrayList cellVisibilityListeners
-
cellClipboardListeners
private java.util.ArrayList<TableCellClipboardListener> cellClipboardListeners
-
image
private org.eclipse.swt.graphics.Image image
-
imageBounds
private org.eclipse.swt.graphics.Rectangle imageBounds
-
marginHeight
private int marginHeight
-
orientation
private int orientation
-
marginWidth
private int marginWidth
-
sortValue
private java.lang.Comparable sortValue
-
coreDataSource
private java.lang.Object coreDataSource
-
composite
private org.eclipse.swt.widgets.Composite composite
-
tableColumn
private final TableColumnCore tableColumn
-
graphic
private Graphic graphic
-
text
private java.lang.String text
-
pluginDataSource
private java.lang.Object pluginDataSource
-
tooltip
private java.lang.Object tooltip
-
default_tooltip
private java.lang.Object default_tooltip
-
cellArea
private org.eclipse.swt.graphics.Rectangle cellArea
-
hadMore
private boolean hadMore
-
wrapText
private boolean wrapText
-
cellSWTPaintListeners
private java.util.ArrayList cellSWTPaintListeners
-
valid
private boolean valid
-
fakeRow
private TableRow fakeRow
-
userData
private java.util.Map<java.lang.Object,java.lang.Object> userData
-
-
Constructor Detail
-
FakeTableCell
public FakeTableCell(TableColumn column, java.lang.Object ds)
- Parameters:
columnRateUpDown
-
-
FakeTableCell
public FakeTableCell(TableColumnCore column, java.lang.Object ds)
-
-
Method Detail
-
addRefreshListener
public void addRefreshListener(TableCellRefreshListener listener)
Description copied from interface:TableCell
Adds a listener that triggers when the TableCell needs refreshing- Specified by:
addRefreshListener
in interfaceTableCell
- Parameters:
listener
- Listener Object to be called when refresh is needed.
-
removeRefreshListener
public void removeRefreshListener(TableCellRefreshListener listener)
Description copied from interface:TableCell
Remove a previously added TableCellRefreshListener- Specified by:
removeRefreshListener
in interfaceTableCell
- Parameters:
listener
- Previously added listener
-
addDisposeListener
public void addDisposeListener(TableCellDisposeListener listener)
Description copied from interface:TableCell
Adds a listener that triggers when the TableCell has been disposed- Specified by:
addDisposeListener
in interfaceTableCell
- Parameters:
listener
- listener object to be called
-
removeDisposeListener
public void removeDisposeListener(TableCellDisposeListener listener)
Description copied from interface:TableCell
Remove a previously added TableCellDisposeListener- Specified by:
removeDisposeListener
in interfaceTableCell
- Parameters:
listener
- Previously added listener
-
addToolTipListener
public void addToolTipListener(TableCellToolTipListener listener)
Description copied from interface:TableCell
Adds a listener related to tooltip actions- Specified by:
addToolTipListener
in interfaceTableCell
- Parameters:
listener
- listener object to be called
-
removeToolTipListener
public void removeToolTipListener(TableCellToolTipListener listener)
Description copied from interface:TableCell
Remove a previously added TableCellToolTipListener- Specified by:
removeToolTipListener
in interfaceTableCell
- Parameters:
listener
- Previously added listener
-
addMouseListener
public void addMouseListener(TableCellMouseListener listener)
Description copied from interface:TableCell
Adds a listener that triggers when a TableCell that belongs to this column has a mouse event.- Specified by:
addMouseListener
in interfaceTableCell
-
removeMouseListener
public void removeMouseListener(TableCellMouseListener listener)
Description copied from interface:TableCell
Remove a previously added TableCellMouseListener- Specified by:
removeMouseListener
in interfaceTableCell
- Parameters:
listener
- Previously added listener
-
addMouseMoveListener
public void addMouseMoveListener(TableCellMouseMoveListener listener)
-
removeMouseMoveListener
public void removeMouseMoveListener(TableCellMouseMoveListener listener)
-
addVisibilityListener
public void addVisibilityListener(TableCellVisibilityListener listener)
-
removeVisibilityListener
public void removeVisibilityListener(TableCellVisibilityListener listener)
-
addSWTPaintListener
private void addSWTPaintListener(TableCellSWTPaintListener listener)
- Parameters:
listenerObject
-- Since:
- 4.0.0.1
-
invokeSWTPaintListeners
public void invokeSWTPaintListeners(org.eclipse.swt.graphics.GC gc)
-
addCellClipboardListener
private void addCellClipboardListener(TableCellClipboardListener listener)
-
getClipboardText
public java.lang.String getClipboardText()
Description copied from interface:TableCell
Returns text that's meant for the clipboard- Specified by:
getClipboardText
in interfaceTableCell
-
addListeners
public void addListeners(java.lang.Object listenerObject)
Description copied from interface:TableCell
A listener is added for every type of cell listener the supplied object implements- Specified by:
addListeners
in interfaceTableCell
- Parameters:
listenerObject
- Object implementing some cell listeneters
-
invokeMouseListeners
public void invokeMouseListeners(TableCellMouseEvent event)
Description copied from interface:TableCellCore
Trigger all the mouse listeners that have been addded to this cell- Specified by:
invokeMouseListeners
in interfaceTableCellCore
- Parameters:
event
- event to trigger
-
getDataSource
public java.lang.Object getDataSource()
Description copied from interface:TableCell
Retrieve the data object associated with the current table row and cell. The results of this method MUST NOT BE CACHED. The link between a table cell and a DataSource is not persistent and can change from call to call (for example when the table is re-ordered, the link may be modified)- Specified by:
getDataSource
in interfaceTableCell
- 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
-
getForeground
public int[] getForeground()
Description copied from interface:TableCell
Get the foreground color of the cell- Specified by:
getForeground
in interfaceTableCell
- Returns:
- array containing red, green, and blue color
-
getBackground
public int[] getBackground()
Description copied from interface:TableCell
Get the background color of the cell- Specified by:
getBackground
in interfaceTableCell
- Returns:
- array containing red, green, and blue color. Might be null
-
getBackgroundGraphic
public Graphic getBackgroundGraphic()
Description copied from interface:TableCell
Returns a Graphic of what's behind the cell- Specified by:
getBackgroundGraphic
in interfaceTableCell
- Returns:
-
getGraphic
public Graphic getGraphic()
Description copied from interface:TableCell
Retrieve the SWT graphic related to this table item for TableColumn objects of TYPE_GRAPHIC only.- Specified by:
getGraphic
in interfaceTableCell
- Returns:
- the Image that is draw in the cell, or null if there is none.
-
getHeight
public int getHeight()
Description copied from interface:TableCell
Retrieve the height of the cell's drawing area (excluding any margin) for TableColumn objects of TYPE_GRAPHIC only.
-
getMaxLines
public int getMaxLines()
Description copied from interface:TableCell
Retrieves the number of lines available for setting text- Specified by:
getMaxLines
in interfaceTableCell
- Returns:
- # of lines available, -1 if unknown
-
getSortValue
public java.lang.Comparable getSortValue()
Description copied from interface:TableCell
Retrieves the sorting value- Specified by:
getSortValue
in interfaceTableCell
- Returns:
- Object that will be sorted on
-
getTableColumn
public TableColumn getTableColumn()
Description copied from interface:TableCell
Retreive the TableColumn that this cell belongs to- Specified by:
getTableColumn
in interfaceTableCell
- Returns:
- this cell's TableColumn
-
getTableID
public java.lang.String getTableID()
Description copied from interface:TableCell
Returns which table the cell is being displayed in.- Specified by:
getTableID
in interfaceTableCell
- Returns:
TableManager
.TABLE_* constant
-
getTableRow
public TableRow getTableRow()
Description copied from interface:TableCell
Retrieve the TableRow that this cell belongs to- Specified by:
getTableRow
in interfaceTableCell
- Returns:
- this cell's TableRow
-
getText
public java.lang.String getText()
Description copied from interface:TableCell
Retrieve the Cell's text
-
getToolTip
public java.lang.Object getToolTip()
Description copied from interface:TableCell
Retrieve the tooltip object assigned to this cell- Specified by:
getToolTip
in interfaceTableCell
- Returns:
- tooltip object
- See Also:
TableCell.addToolTipListener(TableCellToolTipListener)
-
getWidth
public int getWidth()
Description copied from interface:TableCell
Retrieve the width of the cell's drawing area (excluding any margin) for TableColumn objects of TYPE_GRAPHIC only.
-
invalidate
public void invalidate()
Description copied from interface:TableCell
Sets the cell to invalid. This will result in a refresh on the next scheduled interval.- Specified by:
invalidate
in interfaceTableCell
-
isDisposed
public boolean isDisposed()
Description copied from interface:TableCell
Retrieve whether the cell has been disposed. This will return true after theTableCellDisposeListener
is triggered.- Specified by:
isDisposed
in interfaceTableCell
- Returns:
- disposal state
-
isShown
public boolean isShown()
Description copied from interface:TableCell
Determines if the user has chosen to display the cell
-
isValid
public boolean isValid()
Description copied from interface:TableCell
Validility of the cell's text.
-
setFillCell
public void setFillCell(boolean fillCell)
Description copied from interface:TableCell
Sets whether the graphic fills the whole cell for TableColumn objects of TYPE_GRAPHIC only. This may effect how often a refresh of the cell is needed, and effects alignment.- Specified by:
setFillCell
in interfaceTableCell
- Parameters:
fillCell
- true - the whole cell is filled by the graphic
-
setWrapText
public void setWrapText(boolean wrap)
-
setForeground
public boolean setForeground(int red, int green, int blue)
Description copied from interface:TableCell
Change the cell's foreground color.pass -1 to return color back to default
- Specified by:
setForeground
in interfaceTableCell
- Parameters:
red
- red value (0 - 255)green
- green value (0 - 255)blue
- blue value (0 - 255)- Returns:
- True - Color changed.
False - Color was already set.
-
setForeground
public boolean setForeground(int[] rgb)
Description copied from interface:TableCell
Change the cell's foreground color- Specified by:
setForeground
in interfaceTableCell
- Parameters:
rgb
- int array containing red, green, and blue values, respectively. null to return color back to default- Returns:
-
setForegroundToErrorColor
public boolean setForegroundToErrorColor()
Description copied from interface:TableCell
Change the cell's foreground color to the user's defined "error" color.- Specified by:
setForegroundToErrorColor
in interfaceTableCell
- Returns:
- True - Color changed.
False - Color was already set.
-
setGraphic
public boolean setGraphic(Graphic img)
Description copied from interface:TableCell
Sets the image to be drawn.From 3.0.1.1, setting the graphic to the same Graphic object will not redraw the image. You need to
TableCell.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.
- Specified by:
setGraphic
in interfaceTableCell
- Parameters:
img
- image to be stored & drawn- Returns:
- true - image was changed.
false = image was the same
-
setMarginHeight
public void setMarginHeight(int height)
Description copied from interface:TableCell
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.The default is 1.
- Specified by:
setMarginHeight
in interfaceTableCell
- Parameters:
height
- new margin height
-
setMarginWidth
public void setMarginWidth(int width)
Description copied from interface:TableCell
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.The default is 1.
- Specified by:
setMarginWidth
in interfaceTableCell
- Parameters:
width
- new margin width
-
setSortValue
public boolean setSortValue(java.lang.Comparable valueToSort)
Description copied from interface:TableCell
Sets a Comparable object that column sorting will act on. If you never call setSortValue, your column will be sorted by the cell's text.- Specified by:
setSortValue
in interfaceTableCell
- Parameters:
valueToSort
- the object that will be used when the column cell's are compared to each other- Returns:
- True - Sort Value changed.
False - Sort Value was already set to object supplied.
-
setSortValue
public boolean setSortValue(float valueToSort)
Description copied from interface:TableCell
Sets a float value that the column sorting will act upon.- Specified by:
setSortValue
in interfaceTableCell
- Parameters:
valueToSort
- float sort value- Returns:
- true if sort value changed, or false if sort value already set to value supplied
-
setText
public boolean setText(java.lang.String text)
Description copied from interface:TableCell
This method is called to set the cell's text. Caching is done, so that if same text is used several times, there won't be any 'flickering' effect. Ie the text is only updated if it's different from current value.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
TableCell.invalidate()
, and set the text in theTableCellRefreshListener
-
setToolTip
public void setToolTip(java.lang.Object tooltip)
Description copied from interface:TableCell
Set the cell's tooltip display.- Specified by:
setToolTip
in interfaceTableCell
- Parameters:
tooltip
- Object to display. Currently, only String is supported- See Also:
TableCell.addToolTipListener(TableCellToolTipListener)
-
setDefaultToolTip
public void setDefaultToolTip(java.lang.Object o)
Description copied from interface:TableCellCore
Sets tooltip to be shown in absence of an explicit one- Specified by:
setDefaultToolTip
in interfaceTableCellCore
-
getDefaultToolTip
public java.lang.Object getDefaultToolTip()
- Specified by:
getDefaultToolTip
in interfaceTableCellCore
-
updateTooltip
private void updateTooltip()
-
_setSortValue
private boolean _setSortValue(java.lang.Comparable valueToSort)
-
setSortValue
public boolean setSortValue(long valueToSort)
Description copied from interface:TableCell
Sets a long value that the column sorting will act on.- Specified by:
setSortValue
in interfaceTableCell
- Parameters:
valueToSort
- sorting value.- Returns:
- True - Sort Value changed.
False - Sort Value was already set to value supplied.
-
doPaint
public void doPaint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)
-
refresh
public boolean refresh()
Description copied from interface:TableCellCore
Refresh the cell, including graphic types- Specified by:
refresh
in interfaceTableCellCore
-
setDataSource
public void setDataSource(java.lang.Object _coreDataSource)
-
setControl
public void setControl(org.eclipse.swt.widgets.Composite composite)
-
setControl
public void setControl(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.graphics.Rectangle cellArea, boolean addListeners)
-
paintControl
public void paintControl(org.eclipse.swt.events.PaintEvent e)
- Specified by:
paintControl
in interfaceorg.eclipse.swt.events.PaintListener
-
mouseUp
public void mouseUp(org.eclipse.swt.events.MouseEvent e)
- Specified by:
mouseUp
in interfaceorg.eclipse.swt.events.MouseListener
-
mouseDown
public void mouseDown(org.eclipse.swt.events.MouseEvent e)
- Specified by:
mouseDown
in interfaceorg.eclipse.swt.events.MouseListener
-
mouseDoubleClick
public void mouseDoubleClick(org.eclipse.swt.events.MouseEvent e)
- Specified by:
mouseDoubleClick
in interfaceorg.eclipse.swt.events.MouseListener
-
mouseMove
public void mouseMove(org.eclipse.swt.events.MouseEvent e)
- Specified by:
mouseMove
in interfaceorg.eclipse.swt.events.MouseMoveListener
-
mouseHover
public void mouseHover(org.eclipse.swt.events.MouseEvent e)
- Specified by:
mouseHover
in interfaceorg.eclipse.swt.events.MouseTrackListener
-
mouseExit
public void mouseExit(org.eclipse.swt.events.MouseEvent e)
- Specified by:
mouseExit
in interfaceorg.eclipse.swt.events.MouseTrackListener
-
mouseEnter
public void mouseEnter(org.eclipse.swt.events.MouseEvent e)
- Specified by:
mouseEnter
in interfaceorg.eclipse.swt.events.MouseTrackListener
-
buildMouseEvent
protected TableCellMouseEvent buildMouseEvent(org.eclipse.swt.events.MouseEvent e, int eventType)
- Parameters:
e
-- Returns:
- Since:
- 3.0.2.1
-
setOrientationViaColumn
private void setOrientationViaColumn()
-
dispose
public void dispose()
Description copied from interface:TableCellCore
dispose of the cell- Specified by:
dispose
in interfaceTableCellCore
-
getCursorID
public int getCursorID()
Description copied from interface:TableCellCore
Get the cursor ID we are currently using XXX Should NOT be SWT.CURSOR_ constants!- Specified by:
getCursorID
in interfaceTableCellCore
- Returns:
-
getObfuscatedText
public java.lang.String getObfuscatedText()
Description copied from interface:TableCellCore
Return the text used when generating diagnostics- Specified by:
getObfuscatedText
in interfaceTableCellCore
- Returns:
-
getTableRowCore
public TableRowCore getTableRowCore()
Description copied from interface:TableCellCore
Retrieve the row that this cell belongs to- Specified by:
getTableRowCore
in interfaceTableCellCore
- Returns:
- the row that this cell belongs to
-
getVisuallyChangedSinceRefresh
public boolean getVisuallyChangedSinceRefresh()
Description copied from interface:TableCellCore
Returns whether the cell has visually changed since the last refresh call. Could be used to prevent a refresh, or refresh early.- Specified by:
getVisuallyChangedSinceRefresh
in interfaceTableCellCore
- Returns:
- visually changed since refresh state
-
invalidate
public void invalidate(boolean mustRefresh)
- Specified by:
invalidate
in interfaceTableCellCore
-
invokeToolTipListeners
public void invokeToolTipListeners(int type)
Description copied from interface:TableCellCore
Trigger all the tooltip listeners that have been added to this cell- Specified by:
invokeToolTipListeners
in interfaceTableCellCore
- Parameters:
type
-TableCellCore.TOOLTIPLISTENER_HOVER
,TableCellCore.TOOLTIPLISTENER_HOVERCOMPLETE
-
invokeVisibilityListeners
public void invokeVisibilityListeners(int visibility, boolean invokeColumnListeners)
Description copied from interface:TableCellCore
Trigger all the visibility listeners that have been added to this cell.- Specified by:
invokeVisibilityListeners
in interfaceTableCellCore
- Parameters:
visibility
- SeeTableCellVisibilityListener
.VISIBILITY_* constants
-
isMouseOver
public boolean isMouseOver()
- Specified by:
isMouseOver
in interfaceTableCellCore
-
setMouseOver
public void setMouseOver(boolean b)
- Specified by:
setMouseOver
in interfaceTableCellSWT
-
isUpToDate
public boolean isUpToDate()
Description copied from interface:TableCellCore
Returns whether the cell will need updating when it's visible again- Specified by:
isUpToDate
in interfaceTableCellCore
- Returns:
-
locationChanged
public void locationChanged()
Description copied from interface:TableCellCore
Location of the cell has changed- Specified by:
locationChanged
in interfaceTableCellCore
-
needsPainting
public boolean needsPainting()
Description copied from interface:TableCellCore
Retrieve whether the cell need any paint calls (graphic)- Specified by:
needsPainting
in interfaceTableCellCore
- Returns:
- whether the cell needs painting
-
refresh
public boolean refresh(boolean doGraphics)
Description copied from interface:TableCellCore
Refresh the cell- Specified by:
refresh
in interfaceTableCellCore
- Parameters:
doGraphics
- Whether to update graphic cells
-
refresh
public boolean refresh(boolean doGraphics, boolean rowVisible, boolean cellVisible)
Description copied from interface:TableCellCore
Refresh the cell. This method overide takes a bRowVisible paramater and a bCellVisible parameter in order to reduce the number of calls to TableRow.isVisible() and calculations of cell visibility.- Specified by:
refresh
in interfaceTableCellCore
- Parameters:
doGraphics
- Whether to update graphic cellsrowVisible
- Assumed visibility state of rowcellVisible
- Assumed visibility state of the cell
-
refresh
public boolean refresh(boolean doGraphics, boolean rowVisible)
Description copied from interface:TableCellCore
Refresh the cell. This method override takes a bRowVisible parameter in order to reduce the number of calls to TableRow.isVisible() in cases where multiple cells on the same row are being refreshed.- Specified by:
refresh
in interfaceTableCellCore
- Parameters:
doGraphics
- Whether to update graphic cellsrowVisible
- Visibility state of row
-
setCursorID
public boolean setCursorID(int cursorID)
Description copied from interface:TableCellCore
Set the cursor ID that should be used for the cell- Specified by:
setCursorID
in interfaceTableCellCore
- Returns:
- changed
-
setUpToDate
public void setUpToDate(boolean upToDate)
Description copied from interface:TableCellCore
Sets whether the cell will need updating when it's visible again- Specified by:
setUpToDate
in interfaceTableCellCore
-
compareTo
public int compareTo(java.lang.Object arg0)
- Specified by:
compareTo
in interfacejava.lang.Comparable
-
setOrentation
public void setOrentation(int o)
-
getCellArea
public org.eclipse.swt.graphics.Rectangle getCellArea()
-
setCellArea
public void setCellArea(org.eclipse.swt.graphics.Rectangle cellArea)
-
getMouseOffset
public int[] getMouseOffset()
Description copied from interface:TableCell
Return the position of the mouse relative to the cell.- Specified by:
getMouseOffset
in interfaceTableCell
- Returns:
- array of 2 containing x and y position position relative to cell. null if cell doesn't have mouse.
-
getMarginHeight
public int getMarginHeight()
- Specified by:
getMarginHeight
in interfaceTableCell
- Returns:
-
getMarginWidth
public int getMarginWidth()
- Specified by:
getMarginWidth
in interfaceTableCell
- Returns:
-
refreshAsync
public void refreshAsync()
- Specified by:
refreshAsync
in interfaceTableCellCore
-
redraw
public void redraw()
- Specified by:
redraw
in interfaceTableCellCore
-
doPaint
public void doPaint(org.eclipse.swt.graphics.GC gc)
Description copied from interface:TableCellSWT
Paint the cell (for graphics)- Specified by:
doPaint
in interfaceTableCellSWT
- Parameters:
gc
- GC object to be used for painting
-
getBackgroundImage
public org.eclipse.swt.graphics.Image getBackgroundImage()
- Specified by:
getBackgroundImage
in interfaceTableCellSWT
- Returns:
-
getBackgroundSWT
public org.eclipse.swt.graphics.Color getBackgroundSWT()
- Specified by:
getBackgroundSWT
in interfaceTableCellSWT
- Returns:
-
getBounds
public org.eclipse.swt.graphics.Rectangle getBounds()
- Specified by:
getBounds
in interfaceTableCellSWT
-
getForegroundSWT
public org.eclipse.swt.graphics.Color getForegroundSWT()
- Specified by:
getForegroundSWT
in interfaceTableCellSWT
- Returns:
-
getGraphicSWT
public org.eclipse.swt.graphics.Image getGraphicSWT()
- Specified by:
getGraphicSWT
in interfaceTableCellSWT
-
getIcon
public org.eclipse.swt.graphics.Image getIcon()
- Specified by:
getIcon
in interfaceTableCellSWT
- Returns:
-
getSize
public org.eclipse.swt.graphics.Point getSize()
- Specified by:
getSize
in interfaceTableCellSWT
-
getTableRowSWT
public TableRowSWT getTableRowSWT()
- Specified by:
getTableRowSWT
in interfaceTableCellSWT
- Returns:
-
getTextAlpha
public int getTextAlpha()
- Specified by:
getTextAlpha
in interfaceTableCellSWT
- Returns:
-
setForeground
public boolean setForeground(org.eclipse.swt.graphics.Color color)
Description copied from interface:TableCellSWT
Change the cell's foreground color. NOTE: favor (R, G, B)- Specified by:
setForeground
in interfaceTableCellSWT
- Parameters:
color
- SWT Color object.- Returns:
- True - Color changed.
False - Color was already set.
-
setGraphic
public boolean setGraphic(org.eclipse.swt.graphics.Image img)
- Specified by:
setGraphic
in interfaceTableCellSWT
-
setIcon
public boolean setIcon(org.eclipse.swt.graphics.Image img)
Description copied from interface:TableCellSWT
Set the cell's icon- Specified by:
setIcon
in interfaceTableCellSWT
- Parameters:
img
- Cell's new icon- Returns:
- true if the icon will be used
-
setTextAlpha
public void setTextAlpha(int textOpacity)
- Specified by:
setTextAlpha
in interfaceTableCellSWT
-
getBoundsOnDisplay
public org.eclipse.swt.graphics.Rectangle getBoundsOnDisplay()
- Specified by:
getBoundsOnDisplay
in interfaceTableCellSWT
-
getTableColumnCore
public TableColumnCore getTableColumnCore()
- Specified by:
getTableColumnCore
in interfaceTableCellCore
-
useSimpleSortValue
public boolean useSimpleSortValue()
Description copied from interface:TableCell
When true, the user is sorting by multiple columns, and you should set the cell's sort value based solely on your column's data.- Specified by:
useSimpleSortValue
in interfaceTableCell
-
getData
public java.lang.Object getData(java.lang.Object key)
- Specified by:
getData
in interfaceTableCellCore
-
setData
public void setData(java.lang.Object key, java.lang.Object data)
- Specified by:
setData
in interfaceTableCellCore
-
-