|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.ui.swt.views.table.impl.TableCellSWTBase
public abstract class TableCellSWTBase
Field Summary | |
---|---|
boolean |
bDebug
|
protected java.util.ArrayList<TableCellSWTPaintListener> |
cellSWTPaintListeners
|
protected static int |
FLAG_DISPOSED
|
protected static int |
FLAG_MUSTREFRESH
Cell has been invalidated, it must refresh on next cycle |
protected static int |
FLAG_SORTVALUEISTEXT
Indicates if the sort value is also the text displayed. |
protected static int |
FLAG_TOOLTIPISAUTO
Indicates if the tooltip is autogenerated |
protected 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 set |
protected static int |
MAX_REFRESHES
|
protected int |
numFastRefreshes
|
protected java.util.ArrayList<TableCellRefreshListener> |
refreshListeners
|
protected java.lang.Comparable |
sortValue
|
protected TableColumnCore |
tableColumn
|
protected TableRowCore |
tableRow
|
Fields inherited from interface com.aelitis.azureus.ui.common.table.TableCellCore |
---|
TOOLTIPLISTENER_HOVER, TOOLTIPLISTENER_HOVERCOMPLETE |
Constructor Summary | |
---|---|
TableCellSWTBase(TableRowCore row,
TableColumnCore column)
|
Method Summary | |
---|---|
void |
addDisposeListener(TableCellDisposeListener listener)
Adds a listener that triggers when the TableCell has been disposed |
void |
addListeners(java.lang.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 |
addMouseMoveListener(TableCellMouseMoveListener listener)
|
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 |
void |
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 cell |
void |
doPaint(org.eclipse.swt.graphics.GC gc)
Paint the cell (for graphics) |
int[] |
getBackground()
Get the background color of the cell |
java.lang.String |
getClipboardText()
Returns text that's meant for the clipboard |
int |
getCursorID()
Get the cursor ID we are currently using XXX Should NOT be SWT.CURSOR_ constants! |
java.lang.Object |
getDefaultToolTip()
|
boolean |
getFillCell()
|
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. |
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 |
getObfusticatedText()
Return the text used when generating diagnostics |
java.lang.Comparable |
getSortValue()
Retrieves the sorting value |
TableColumnCore |
getTableColumnCore()
|
TableRowCore |
getTableRowCore()
Retrieve the row that this cell belongs to |
TableRowSWT |
getTableRowSWT()
|
int |
getTextAlpha()
|
java.lang.Object |
getToolTip()
Retrieve the tooltip object assigned to this cell |
boolean |
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 cell |
void |
invokeSWTPaintListeners(org.eclipse.swt.graphics.GC gc)
|
void |
invokeToolTipListeners(int type)
Trigger all the tooltip listeners that have been added to this cell |
void |
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 again |
boolean |
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 types |
boolean |
refresh(boolean bDoGraphics)
Refresh the cell |
boolean |
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 TableCellDisposeListener |
void |
removeMouseListener(TableCellMouseListener listener)
Remove a previously added TableCellMouseListener |
void |
removeMouseMoveListener(TableCellMouseMoveListener listener)
|
void |
removeRefreshListener(TableCellRefreshListener listener)
Remove a previously added TableCellRefreshListener |
void |
removeToolTipListener(TableCellToolTipListener listener)
Remove a previously added TableCellToolTipListener |
void |
removeVisibilityListener(TableCellVisibilityListener listener)
|
boolean |
setCursorID(int cursorID)
Set the cursor ID that should be used for the cell |
void |
setDefaultToolTip(java.lang.Object tt)
Sets tooltip to be shown in absence of an explicit one |
void |
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 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. |
boolean |
setGraphic(org.eclipse.swt.graphics.Image img)
|
boolean |
setIcon(org.eclipse.swt.graphics.Image img)
Set the cell's icon |
void |
setMouseOver(boolean b)
|
boolean |
setSortValue(java.lang.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(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 again |
abstract boolean |
uiSetText(java.lang.String text)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.gudy.azureus2.ui.swt.views.table.TableCellSWT |
---|
getBackgroundImage, getBackgroundSWT, getBounds, getBoundsOnDisplay, getForegroundSWT, getSize, setForeground |
Methods inherited from interface com.aelitis.azureus.ui.common.table.TableCellCore |
---|
locationChanged, redraw |
Methods inherited from interface org.gudy.azureus2.plugins.ui.tables.TableCell |
---|
getBackgroundGraphic, getDataSource, getHeight, getMarginHeight, getMarginWidth, getMaxLines, getTableColumn, getTableID, getTableRow, getText, getWidth, isShown, setMarginHeight, setMarginWidth |
Field Detail |
---|
protected static final int FLAG_VALID
invalidate()
will clear this flag, causing the cell to set its ui again
protected static final int FLAG_SORTVALUEISTEXT
protected static final int FLAG_TOOLTIPISAUTO
protected static final int FLAG_UPTODATE
protected static final int FLAG_DISPOSED
protected static final int FLAG_MUSTREFRESH
public static final int FLAG_VISUALLY_CHANGED_SINCE_REFRESH
protected TableRowCore tableRow
protected TableColumnCore tableColumn
public boolean bDebug
protected java.util.ArrayList<TableCellRefreshListener> refreshListeners
protected java.util.ArrayList<TableCellSWTPaintListener> cellSWTPaintListeners
protected java.lang.Comparable sortValue
protected static int MAX_REFRESHES
protected int numFastRefreshes
Constructor Detail |
---|
public TableCellSWTBase(TableRowCore row, TableColumnCore column)
Method Detail |
---|
protected void constructionComplete()
protected abstract void constructionCompleter()
public void addRefreshListener(TableCellRefreshListener listener)
TableCell
addRefreshListener
in interface TableCell
listener
- Listener Object to be called when refresh is needed.public void removeRefreshListener(TableCellRefreshListener listener)
TableCell
removeRefreshListener
in interface TableCell
listener
- Previously added listenerpublic void addDisposeListener(TableCellDisposeListener listener)
TableCell
addDisposeListener
in interface TableCell
listener
- listener object to be calledpublic void removeDisposeListener(TableCellDisposeListener listener)
TableCell
removeDisposeListener
in interface TableCell
listener
- Previously added listenerpublic void addToolTipListener(TableCellToolTipListener listener)
TableCell
addToolTipListener
in interface TableCell
listener
- listener object to be calledpublic void removeToolTipListener(TableCellToolTipListener listener)
TableCell
removeToolTipListener
in interface TableCell
listener
- Previously added listenerpublic void addMouseListener(TableCellMouseListener listener)
TableCell
addMouseListener
in interface TableCell
public void removeMouseListener(TableCellMouseListener listener)
TableCell
removeMouseListener
in interface TableCell
listener
- Previously added listenerpublic void addMouseMoveListener(TableCellMouseMoveListener listener)
public void removeMouseMoveListener(TableCellMouseMoveListener listener)
public void addVisibilityListener(TableCellVisibilityListener listener)
public void removeVisibilityListener(TableCellVisibilityListener listener)
public void invokeSWTPaintListeners(org.eclipse.swt.graphics.GC gc)
public java.lang.String getClipboardText()
TableCell
getClipboardText
in interface TableCell
public void addListeners(java.lang.Object listenerObject)
TableCell
addListeners
in interface TableCell
listenerObject
- Object implementing some cell listeneterspublic void invokeToolTipListeners(int type)
TableCellCore
invokeToolTipListeners
in interface TableCellCore
type
- TableCellCore.TOOLTIPLISTENER_HOVER
, TableCellCore.TOOLTIPLISTENER_HOVERCOMPLETE
public void invokeMouseListeners(TableCellMouseEvent event)
TableCellCore
invokeMouseListeners
in interface TableCellCore
event
- event to triggerpublic void invokeVisibilityListeners(int visibility, boolean invokeColumnListeners)
TableCellCore
invokeVisibilityListeners
in interface TableCellCore
visibility
- See TableCellVisibilityListener
.VISIBILITY_* constantspublic void dispose()
TableCellCore
dispose
in interface TableCellCore
public void debug(java.lang.String s)
protected void pluginError(java.lang.Throwable e)
protected void pluginError(java.lang.String s)
public boolean refresh()
TableCellCore
refresh
in interface TableCellCore
public boolean refresh(boolean bDoGraphics)
TableCellCore
refresh
in interface TableCellCore
bDoGraphics
- Whether to update graphic cellspublic boolean refresh(boolean bDoGraphics, boolean bRowVisible)
TableCellCore
refresh
in interface TableCellCore
bDoGraphics
- Whether to update graphic cellsbRowVisible
- Visibility state of rowpublic boolean refresh(boolean bDoGraphics, boolean bRowVisible, boolean bCellVisible)
TableCellCore
refresh
in interface TableCellCore
bDoGraphics
- Whether to update graphic cellsbRowVisible
- Assumed visibility state of rowbCellVisible
- Assumed visibility state of the cellpublic boolean setSortValue(java.lang.Comparable valueToSort)
TableCell
setSortValue
in interface TableCell
valueToSort
- the object that will be used when the column cell's
are compared to each other
public boolean setSortValue(long valueToSort)
TableCell
setSortValue
in interface TableCell
valueToSort
- sorting value.
public boolean setSortValue(float valueToSort)
TableCell
setSortValue
in interface TableCell
valueToSort
- float sort value
public java.lang.Comparable getSortValue()
TableCell
getSortValue
in interface TableCell
public boolean isValid()
TableCell
isValid
in interface TableCell
public boolean isDisposed()
TableCell
TableCellDisposeListener
is triggered.
isDisposed
in interface TableCell
public boolean hasFlag(int flag)
public void setFlag(int flag)
public void clearFlag(int flag)
public void invalidate()
invalidate
in interface TableCell
public void invalidate(boolean bMustRefresh)
invalidate
in interface TableCellCore
public void refreshAsync()
refreshAsync
in interface TableCellCore
public void setUpToDate(boolean upToDate)
TableCellCore
setUpToDate
in interface TableCellCore
public boolean isUpToDate()
TableCellCore
isUpToDate
in interface TableCellCore
public boolean getVisuallyChangedSinceRefresh()
TableCellCore
getVisuallyChangedSinceRefresh
in interface TableCellCore
public void clearVisuallyChangedSinceRefresh()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public boolean needsPainting()
TableCellCore
needsPainting
in interface TableCellCore
public boolean setText(java.lang.String text)
TableCell
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 the
TableCellRefreshListener
setText
in interface TableCell
text
- the text to be set
public void setToolTip(java.lang.Object tooltip)
TableCell
setToolTip
in interface TableCell
tooltip
- Object to display. Currently, only String is supportedTableCell.addToolTipListener(TableCellToolTipListener)
public java.lang.Object getToolTip()
TableCell
getToolTip
in interface TableCell
TableCell.addToolTipListener(TableCellToolTipListener)
public java.lang.Object getDefaultToolTip()
getDefaultToolTip
in interface TableCellCore
public void setDefaultToolTip(java.lang.Object tt)
TableCellCore
setDefaultToolTip
in interface TableCellCore
public abstract boolean uiSetText(java.lang.String text)
public void doPaint(org.eclipse.swt.graphics.GC gc)
TableCellSWT
doPaint
in interface TableCellSWT
gc
- GC object to be used for paintingpublic int getTextAlpha()
getTextAlpha
in interface TableCellSWT
public void setTextAlpha(int textOpacity)
setTextAlpha
in interface TableCellSWT
public TableRowSWT getTableRowSWT()
getTableRowSWT
in interface TableCellSWT
public TableRowCore getTableRowCore()
TableCellCore
getTableRowCore
in interface TableCellCore
public abstract int getWidthRaw()
public void setFillCell(boolean doFillCell)
TableCell
setFillCell
in interface TableCell
doFillCell
- true - the whole cell is filled by the graphicpublic boolean getFillCell()
public TableColumnCore getTableColumnCore()
getTableColumnCore
in interface TableCellCore
public boolean setCursorID(int cursorID)
TableCellCore
setCursorID
in interface TableCellCore
public int getCursorID()
TableCellCore
getCursorID
in interface TableCellCore
public void setMouseOver(boolean b)
setMouseOver
in interface TableCellSWT
public boolean isMouseOver()
isMouseOver
in interface TableCellCore
public boolean setIcon(org.eclipse.swt.graphics.Image img)
TableCellSWT
setIcon
in interface TableCellSWT
img
- Cell's new icon
public org.eclipse.swt.graphics.Image getIcon()
getIcon
in interface TableCellSWT
public boolean setGraphic(org.eclipse.swt.graphics.Image img)
setGraphic
in interface TableCellSWT
public boolean setGraphic(Graphic img)
TableCell
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.
setGraphic
in interface TableCell
img
- image to be stored & drawn
public Graphic getGraphic()
TableCell
getGraphic
in interface TableCell
public org.eclipse.swt.graphics.Image getGraphicSWT()
getGraphicSWT
in interface TableCellSWT
public boolean isInvisibleAndCanRefresh()
public int[] getBackground()
TableCell
getBackground
in interface TableCell
public int[] getForeground()
TableCell
getForeground
in interface TableCell
public boolean setForeground(int red, int green, int blue)
TableCell
pass -1 to return color back to default
setForeground
in interface TableCell
red
- red value (0 - 255)green
- green value (0 - 255)blue
- blue value (0 - 255)
public boolean setForeground(int[] rgb)
TableCell
setForeground
in interface TableCell
rgb
- int array containing red, green, and blue values, respectively.
null to return color back to default
public boolean setForegroundToErrorColor()
TableCell
setForegroundToErrorColor
in interface TableCell
public int[] getMouseOffset()
TableCell
getMouseOffset
in interface TableCell
public java.lang.String getObfusticatedText()
TableCellCore
getObfusticatedText
in interface TableCellCore
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |