Class TableCellSWTBase
- java.lang.Object
-
- com.biglybt.ui.swt.views.table.impl.TableCellSWTBase
-
- All Implemented Interfaces:
TableCell
,TableCellCore
,TableCellSWT
,java.lang.Comparable
- Direct Known Subclasses:
TableCellPainted
public abstract class TableCellSWTBase extends java.lang.Object implements TableCellSWT
-
-
Field Summary
Fields Modifier and Type Field Description boolean
bDebug
private boolean
bInRefresh
private boolean
bInRefreshAsync
private java.util.ArrayList<TableCellClipboardListener>
cellClipboardListeners
private java.util.ArrayList<TableCellMouseListener>
cellMouseListeners
private java.util.ArrayList<TableCellMouseMoveListener>
cellMouseMoveListeners
protected java.util.ArrayList<TableCellSWTPaintListener>
cellSWTPaintListeners
private java.util.ArrayList<TableCellVisibilityListener>
cellVisibilityListeners
private static boolean
DEBUG_FLAGS
private static boolean
DEBUGONLYZERO
private java.lang.Object
defaultToolTip
private java.util.ArrayList<TableCellDisposeListener>
disposeListeners
private boolean
doFillCell
protected static int
FLAG_DISPOSED
protected static int
FLAG_MUSTREFRESH
Cell has been invalidated, it must refresh on next cycleprotected static int
FLAG_SORTVALUEISTEXT
Indicates if the sort value is also the text displayed.protected static int
FLAG_TOOLTIPISAUTO
Indicates if the tooltip is autogeneratedprotected static int
FLAG_UPTODATE
For refreshing, this flag manages whether the row is actually up to date.protected static int
FLAG_VALID
Plugins read this to see if their datasource has changed.static int
FLAG_VISUALLY_CHANGED_SINCE_REFRESH
If any visuals change between 2 refreshes, this flag gets setprivate int
flags
private Graphic
graphic
private org.eclipse.swt.graphics.Image
icon
private int
iCursorID
private long
lastRefresh
private static LogIDs
LOGID
private byte
loopFactor
protected static int
MAX_REFRESHES
private static int
MAX_REFRESHES_WITHIN_MS
private boolean
mouseOver
protected int
numFastRefreshes
private java.lang.Object
oToolTip
private byte
refreshErrLoopCount
protected java.util.ArrayList<TableCellRefreshListener>
refreshListeners
private byte
restartRefresh
protected java.lang.Comparable
sortValue
protected TableColumnCore
tableColumnCore
protected TableColumnSWTBase
tableColumnSWT
protected TableRowSWTBase
tableRowSWT
private int
textAlpha
private static AEMonitor
this_mon
private byte
tooltipErrLoopCount
private java.util.ArrayList<TableCellToolTipListener>
tooltipListeners
private java.util.Map<java.lang.Object,java.lang.Object>
userData
-
Fields inherited from interface com.biglybt.ui.common.table.TableCellCore
TOOLTIPLISTENER_HOVER, TOOLTIPLISTENER_HOVERCOMPLETE
-
-
Constructor Summary
Constructors Constructor Description TableCellSWTBase(TableRowSWTBase row, TableColumnSWTBase column)
-
Method Summary
All Methods Instance Methods Abstract 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)
void
clearFlag(int flag)
void
clearVisuallyChangedSinceRefresh()
int
compareTo(java.lang.Object o)
Compare our sortValue to the specified object.protected void
constructionComplete()
protected abstract void
constructionCompleter()
void
debug(java.lang.String s)
void
dispose()
dispose of the cellvoid
doPaint(org.eclipse.swt.graphics.GC gc)
Paint the cell (for graphics)private java.lang.String
flagToText(int flag, boolean onlySet)
int[]
getBackground()
Get the background color of the celljava.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
getDefaultToolTip()
boolean
getFillCell()
int[]
getForeground()
Get the foreground color of the cellGraphic
getGraphic()
Retrieve the SWT graphic related to this table item for TableColumn objects of TYPE_GRAPHIC only.org.eclipse.swt.graphics.Image
getGraphicSWT()
org.eclipse.swt.graphics.Image
getIcon()
int[]
getMouseOffset()
Return the position of the mouse relative to the cell.java.lang.String
getObfuscatedText()
Return the text used when generating diagnosticsjava.lang.Comparable
getSortValue()
Retrieves the sorting valueTableColumnCore
getTableColumnCore()
TableColumnSWT
getTableColumnSWT()
TableRowCore
getTableRowCore()
Retrieve the row that this cell belongs toTableRowSWT
getTableRowSWT()
int
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.abstract int
getWidthRaw()
boolean
hasFlag(int flag)
void
invalidate()
If a plugin in trying to invalidate a cell, then clear the sort value too.void
invalidate(boolean bMustRefresh)
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
isInvisibleAndCanRefresh()
boolean
isMouseOver()
boolean
isUpToDate()
Returns whether the cell will need updating when it's visible againboolean
isValid()
Validility of the cell's text.boolean
needsPainting()
Retrieve whether the cell need any paint calls (graphic)protected void
pluginError(java.lang.String s)
protected void
pluginError(java.lang.Throwable e)
boolean
refresh()
Refresh the cell, including graphic typesboolean
refresh(boolean bDoGraphics)
Refresh the cellboolean
refresh(boolean bDoGraphics, boolean bRowVisible)
Refresh the cell.boolean
refresh(boolean bDoGraphics, boolean bRowVisible, boolean bCellVisible)
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)
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
setDefaultToolTip(java.lang.Object tt)
Sets tooltip to be shown in absence of an explicit onevoid
setFillCell(boolean doFillCell)
Sets whether the graphic fills the whole cell for TableColumn objects of TYPE_GRAPHIC only.void
setFlag(int flag)
boolean
setForeground(int[] rgb)
Change the cell's foreground colorboolean
setForeground(int red, int green, int blue)
Change the cell's foreground color.private boolean
setForeground(org.eclipse.swt.graphics.RGB rgb)
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
setMouseOver(boolean b)
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 againabstract boolean
uiSetText(java.lang.String text)
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
getBackgroundGraphic, getDataSource, getHeight, getMarginHeight, getMarginWidth, getMaxLines, getTableColumn, getTableID, getTableRow, getText, getWidth, isSecondarySortEnabled, isShown, setMarginHeight, setMarginWidth
-
Methods inherited from interface com.biglybt.ui.common.table.TableCellCore
locationChanged, redraw
-
Methods inherited from interface com.biglybt.ui.swt.views.table.TableCellSWT
getBackgroundImage, getBackgroundSWT, getBounds, getBoundsOnDisplay, getForegroundSWT, getSize, setForeground
-
-
-
-
Field Detail
-
LOGID
private static final LogIDs LOGID
-
this_mon
private static AEMonitor this_mon
-
FLAG_VALID
protected static final int FLAG_VALID
Plugins read this to see if their datasource has changed.invalidate()
will clear this flag, causing the cell to set its ui again- See Also:
- Constant Field Values
-
FLAG_SORTVALUEISTEXT
protected static final int FLAG_SORTVALUEISTEXT
Indicates if the sort value is also the text displayed. We can optimize.- See Also:
- Constant Field Values
-
FLAG_TOOLTIPISAUTO
protected static final int FLAG_TOOLTIPISAUTO
Indicates if the tooltip is autogenerated- See Also:
- Constant Field Values
-
FLAG_UPTODATE
protected static final int FLAG_UPTODATE
For refreshing, this flag manages whether the row is actually up to date. We don't update any visuals while the row isn't visible. But, validility does get set to true so that the cell isn't forced to refresh every cycle when not visible. (We can't just never call refresh when the row is not visible, as refresh also sets the sort value) When the row does become visible, we have to invalidate the row so that the row will set its visuals again (this time, actually updating a viewable object).- See Also:
- Constant Field Values
-
FLAG_DISPOSED
protected static final int FLAG_DISPOSED
- See Also:
- Constant Field Values
-
FLAG_MUSTREFRESH
protected static final int FLAG_MUSTREFRESH
Cell has been invalidated, it must refresh on next cycle- See Also:
- Constant Field Values
-
FLAG_VISUALLY_CHANGED_SINCE_REFRESH
public static final int FLAG_VISUALLY_CHANGED_SINCE_REFRESH
If any visuals change between 2 refreshes, this flag gets set- See Also:
- Constant Field Values
-
DEBUGONLYZERO
private static final boolean DEBUGONLYZERO
- See Also:
- Constant Field Values
-
DEBUG_FLAGS
private static final boolean DEBUG_FLAGS
- See Also:
- Constant Field Values
-
flags
private int flags
-
tableRowSWT
protected TableRowSWTBase tableRowSWT
-
tableColumnSWT
protected TableColumnSWTBase tableColumnSWT
-
tableColumnCore
protected TableColumnCore tableColumnCore
-
tooltipErrLoopCount
private byte tooltipErrLoopCount
-
bDebug
public boolean bDebug
-
refreshListeners
protected java.util.ArrayList<TableCellRefreshListener> refreshListeners
-
disposeListeners
private java.util.ArrayList<TableCellDisposeListener> disposeListeners
-
tooltipListeners
private java.util.ArrayList<TableCellToolTipListener> tooltipListeners
-
cellMouseListeners
private java.util.ArrayList<TableCellMouseListener> cellMouseListeners
-
cellMouseMoveListeners
private java.util.ArrayList<TableCellMouseMoveListener> cellMouseMoveListeners
-
cellVisibilityListeners
private java.util.ArrayList<TableCellVisibilityListener> cellVisibilityListeners
-
cellSWTPaintListeners
protected java.util.ArrayList<TableCellSWTPaintListener> cellSWTPaintListeners
-
cellClipboardListeners
private java.util.ArrayList<TableCellClipboardListener> cellClipboardListeners
-
sortValue
protected java.lang.Comparable sortValue
-
restartRefresh
private byte restartRefresh
-
bInRefreshAsync
private boolean bInRefreshAsync
-
refreshErrLoopCount
private byte refreshErrLoopCount
-
loopFactor
private byte loopFactor
-
MAX_REFRESHES
protected static int MAX_REFRESHES
-
MAX_REFRESHES_WITHIN_MS
private static int MAX_REFRESHES_WITHIN_MS
-
bInRefresh
private boolean bInRefresh
-
lastRefresh
private long lastRefresh
-
numFastRefreshes
protected int numFastRefreshes
-
oToolTip
private java.lang.Object oToolTip
-
defaultToolTip
private java.lang.Object defaultToolTip
-
textAlpha
private int textAlpha
-
doFillCell
private boolean doFillCell
-
iCursorID
private int iCursorID
-
mouseOver
private boolean mouseOver
-
icon
private org.eclipse.swt.graphics.Image icon
-
graphic
private Graphic graphic
-
userData
private java.util.Map<java.lang.Object,java.lang.Object> userData
-
-
Constructor Detail
-
TableCellSWTBase
public TableCellSWTBase(TableRowSWTBase row, TableColumnSWTBase column)
-
-
Method Detail
-
constructionComplete
protected void constructionComplete()
-
constructionCompleter
protected abstract void constructionCompleter()
-
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:
- 3.1.1.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
-
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
-
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
-
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
-
dispose
public void dispose()
Description copied from interface:TableCellCore
dispose of the cell- Specified by:
dispose
in interfaceTableCellCore
-
debug
public void debug(java.lang.String s)
-
pluginError
protected void pluginError(java.lang.Throwable e)
-
pluginError
protected void pluginError(java.lang.String s)
-
refresh
public boolean refresh()
Description copied from interface:TableCellCore
Refresh the cell, including graphic types- Specified by:
refresh
in interfaceTableCellCore
-
refresh
public boolean refresh(boolean bDoGraphics)
Description copied from interface:TableCellCore
Refresh the cell- Specified by:
refresh
in interfaceTableCellCore
- Parameters:
bDoGraphics
- Whether to update graphic cells
-
refresh
public boolean refresh(boolean bDoGraphics, boolean bRowVisible)
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:
bDoGraphics
- Whether to update graphic cellsbRowVisible
- Visibility state of row
-
refresh
public boolean refresh(boolean bDoGraphics, boolean bRowVisible, boolean bCellVisible)
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:
bDoGraphics
- Whether to update graphic cellsbRowVisible
- Assumed visibility state of rowbCellVisible
- Assumed visibility state of the cell
-
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
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.
-
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
-
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
-
isValid
public boolean isValid()
Description copied from interface:TableCell
Validility of the cell's text.
-
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
-
hasFlag
public boolean hasFlag(int flag)
-
setFlag
public void setFlag(int flag)
-
clearFlag
public void clearFlag(int flag)
-
invalidate
public void invalidate()
If a plugin in trying to invalidate a cell, then clear the sort value too.- Specified by:
invalidate
in interfaceTableCell
-
invalidate
public void invalidate(boolean bMustRefresh)
- Specified by:
invalidate
in interfaceTableCellCore
-
refreshAsync
public void refreshAsync()
- Specified by:
refreshAsync
in interfaceTableCellCore
-
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
-
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:
-
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
-
clearVisuallyChangedSinceRefresh
public void clearVisuallyChangedSinceRefresh()
-
compareTo
public int compareTo(java.lang.Object o)
Compare our sortValue to the specified object. Assumes the object is TableCellSWTBase (safe assumption)- Specified by:
compareTo
in interfacejava.lang.Comparable
-
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
-
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)
-
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)
-
getDefaultToolTip
public java.lang.Object getDefaultToolTip()
- Specified by:
getDefaultToolTip
in interfaceTableCellCore
-
setDefaultToolTip
public void setDefaultToolTip(java.lang.Object tt)
Description copied from interface:TableCellCore
Sets tooltip to be shown in absence of an explicit one- Specified by:
setDefaultToolTip
in interfaceTableCellCore
-
uiSetText
public abstract boolean uiSetText(java.lang.String text)
-
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
-
getTextAlpha
public int getTextAlpha()
- Specified by:
getTextAlpha
in interfaceTableCellSWT
- Returns:
-
setTextAlpha
public void setTextAlpha(int textOpacity)
- Specified by:
setTextAlpha
in interfaceTableCellSWT
-
getTableRowSWT
public TableRowSWT getTableRowSWT()
- Specified by:
getTableRowSWT
in interfaceTableCellSWT
- 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
-
getTableColumnSWT
public TableColumnSWT getTableColumnSWT()
-
flagToText
private java.lang.String flagToText(int flag, boolean onlySet)
-
getWidthRaw
public abstract int getWidthRaw()
-
setFillCell
public void setFillCell(boolean doFillCell)
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:
doFillCell
- true - the whole cell is filled by the graphic
-
getFillCell
public boolean getFillCell()
-
getTableColumnCore
public TableColumnCore getTableColumnCore()
- Specified by:
getTableColumnCore
in interfaceTableCellCore
-
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
-
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:
-
setMouseOver
public void setMouseOver(boolean b)
- Specified by:
setMouseOver
in interfaceTableCellSWT
-
isMouseOver
public boolean isMouseOver()
- Specified by:
isMouseOver
in interfaceTableCellCore
-
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
-
getIcon
public org.eclipse.swt.graphics.Image getIcon()
- Specified by:
getIcon
in interfaceTableCellSWT
- Returns:
-
setGraphic
public boolean setGraphic(org.eclipse.swt.graphics.Image img)
- Specified by:
setGraphic
in interfaceTableCellSWT
-
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
-
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.
-
getGraphicSWT
public org.eclipse.swt.graphics.Image getGraphicSWT()
- Specified by:
getGraphicSWT
in interfaceTableCellSWT
-
isInvisibleAndCanRefresh
public boolean isInvisibleAndCanRefresh()
-
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
-
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
-
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
private boolean setForeground(org.eclipse.swt.graphics.RGB rgb)
-
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.
-
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.
-
getObfuscatedText
public java.lang.String getObfuscatedText()
Description copied from interface:TableCellCore
Return the text used when generating diagnostics- Specified by:
getObfuscatedText
in interfaceTableCellCore
- Returns:
-
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
-
-