Class TableRowSWTBase
- java.lang.Object
-
- com.biglybt.ui.swt.views.table.impl.TableRowSWTBase
-
- All Implemented Interfaces:
TableRow
,TableRowCore
,TableRowSWT
- Direct Known Subclasses:
TableRowPainted
public abstract class TableRowSWTBase extends java.lang.Object implements TableRowSWT
-
-
Field Summary
Fields Modifier and Type Field Description private int
alpha
private boolean
bDisposed
private boolean
bSetNotUpToDateLastRefresh
private java.lang.Object
coreDataSource
private java.util.Map<java.lang.String,java.lang.Object>
dataList
static boolean
DEBUG_ROW_PAINT
private boolean
expanded
private int
fontStyle
private boolean
isAttention
private int
lastIndex
protected java.lang.Object
lock
private java.util.ArrayList<TableRowMouseListener>
mouseListeners
protected java.util.Map<java.lang.String,TableCellSWTBase>
mTableCells
private TableRowCore
parentRow
private java.lang.Object
pluginDataSource
private TableViewSWT
tv
private int
visibleRowIndex
protected boolean
wasShown
-
Fields inherited from interface com.biglybt.ui.common.table.TableRowCore
ID_EXPANDOHITAREA, ID_EXPANDOHITCOLUMN
-
-
Constructor Summary
Constructors Constructor Description TableRowSWTBase(java.lang.Object lock, TableRowCore parentRow, TableViewSWT tv, java.lang.Object dataSource)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addMouseListener(TableRowMouseListener listener)
Adds a listener that triggers when this TableRow has a mouse event.boolean
canExpand()
void
clearCellFlag(int flag, boolean subRows)
void
delete()
Delete the rowboolean
doesAnyCellHaveFlag(int flag)
int
getAlpha()
abstract org.eclipse.swt.graphics.Color
getBackground()
abstract org.eclipse.swt.graphics.Rectangle
getBounds()
java.lang.Object
getData(java.lang.String id)
Get a previously stored valuejava.lang.Object
getDataSource()
Retrieve the data object associated with the current table row.java.lang.Object
getDataSource(boolean bCoreObject)
Retrieve the Data Source related to this rowint
getFontStyle()
abstract org.eclipse.swt.graphics.Color
getForeground()
int
getIndex()
TableRowCore
getParentRowCore()
TableCell
getTableCell(java.lang.String field)
Retrieve a cell based on its column nameTableCellCore
getTableCellCore(java.lang.String name)
Retrieve a cell based on the supplied valueTableCellSWT
getTableCellSWT(java.lang.String name)
java.lang.String
getTableID()
Returns which table the row is being displayed in.TableView
getView()
int
getVisibleRowIndex()
void
invalidate()
Invalidates Rowvoid
invalidate(boolean mustRefersh)
void
invokeMouseListeners(TableRowMouseEvent event)
boolean
isExpanded()
boolean
isFocused()
boolean
isMouseOver()
boolean
isRequestAttention()
boolean
isRowDisposed()
boolean
isSelected()
Retrieve whether the row is selected by the userboolean
isShown()
boolean
isValid()
Validility of the row's cells.boolean
isVisible()
Retreive whether the row is visible to the user.void
locationChanged(int iStartColumn)
Location of a column has changedvoid
redraw()
like refresh, except a different name to confuse us.java.util.List
refresh(boolean bDoGraphics)
Refresh all the cells in the rowjava.util.List<TableCellCore>
refresh(boolean bDoGraphics, boolean bVisible)
void
removeMouseListener(TableRowMouseListener listener)
Remove a previously added TableRowMouseListenerboolean
setAlpha(int alpha)
abstract void
setBackgroundImage(org.eclipse.swt.graphics.Image image)
void
setCellFlag(int flag)
void
setData(java.lang.String id, java.lang.Object data)
Store a value against the table rowvoid
setExpanded(boolean b)
boolean
setFontStyle(int style)
abstract boolean
setIconSize(org.eclipse.swt.graphics.Point pt)
void
setRequestAttention(boolean on)
void
setSelected(boolean selected)
boolean
setShown(boolean b, boolean force)
boolean
setTableItem(int newIndex)
Link the row to a SWT TableItemvoid
setUpToDate(boolean upToDate)
boolean
setVisibleRowIndex(int index)
abstract void
setWidgetSelected(boolean selected)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.biglybt.ui.common.table.TableRowCore
fakeRedraw, getHeight, getLineHeight, getSortColumnCells, getSubItemCount, getSubRow, getSubRowsRecursive, getSubRowsWithNull, isHidden, isInPaintItem, linkSubItem, redraw, refilter, removeSubRow, setHeight, setSortColumn, setSubItemCount, setSubItems, sortSubRows
-
Methods inherited from interface com.biglybt.ui.swt.views.table.TableRowSWT
getFullHeight, requestBackgroundColor, requestForegroundColor
-
-
-
-
Field Detail
-
DEBUG_ROW_PAINT
public static boolean DEBUG_ROW_PAINT
-
lock
protected final java.lang.Object lock
-
tv
private final TableViewSWT tv
-
parentRow
private final TableRowCore parentRow
-
coreDataSource
private final java.lang.Object coreDataSource
-
lastIndex
private int lastIndex
-
visibleRowIndex
private int visibleRowIndex
-
mTableCells
protected java.util.Map<java.lang.String,TableCellSWTBase> mTableCells
-
bDisposed
private boolean bDisposed
-
pluginDataSource
private java.lang.Object pluginDataSource
-
wasShown
protected boolean wasShown
-
bSetNotUpToDateLastRefresh
private boolean bSetNotUpToDateLastRefresh
-
mouseListeners
private java.util.ArrayList<TableRowMouseListener> mouseListeners
-
dataList
private java.util.Map<java.lang.String,java.lang.Object> dataList
-
alpha
private int alpha
-
fontStyle
private int fontStyle
-
expanded
private boolean expanded
-
isAttention
private boolean isAttention
-
-
Constructor Detail
-
TableRowSWTBase
public TableRowSWTBase(java.lang.Object lock, TableRowCore parentRow, TableViewSWT tv, java.lang.Object dataSource)
-
-
Method Detail
-
invalidate
public void invalidate()
Description copied from interface:TableRowCore
Invalidates Row- Specified by:
invalidate
in interfaceTableRowCore
-
invalidate
public void invalidate(boolean mustRefersh)
- Specified by:
invalidate
in interfaceTableRowCore
-
doesAnyCellHaveFlag
public boolean doesAnyCellHaveFlag(int flag)
-
setCellFlag
public void setCellFlag(int flag)
-
clearCellFlag
public void clearCellFlag(int flag, boolean subRows)
-
delete
public void delete()
Description copied from interface:TableRowCore
Delete the row- Specified by:
delete
in interfaceTableRowCore
-
refresh
public java.util.List refresh(boolean bDoGraphics)
Description copied from interface:TableRowCore
Refresh all the cells in the row- Specified by:
refresh
in interfaceTableRowCore
- Parameters:
bDoGraphics
- Refresh graphic cells to
-
locationChanged
public void locationChanged(int iStartColumn)
Description copied from interface:TableRowCore
Location of a column has changed- Specified by:
locationChanged
in interfaceTableRowCore
- Parameters:
iStartColumn
- Cells starting at this value may need repainting XXX Rename to cellLocationChanged?
-
getDataSource
public java.lang.Object getDataSource(boolean bCoreObject)
Description copied from interface:TableRowCore
Retrieve the Data Source related to this row- Specified by:
getDataSource
in interfaceTableRowCore
- Parameters:
bCoreObject
- true - return a core object
false - return a plugin object- Returns:
- the Data Source Object related to the row
-
getIndex
public int getIndex()
- Specified by:
getIndex
in interfaceTableRow
- Specified by:
getIndex
in interfaceTableRowCore
-
setVisibleRowIndex
public boolean setVisibleRowIndex(int index)
- Specified by:
setVisibleRowIndex
in interfaceTableRowCore
-
getVisibleRowIndex
public int getVisibleRowIndex()
- Specified by:
getVisibleRowIndex
in interfaceTableRowCore
-
getTableCellCore
public TableCellCore getTableCellCore(java.lang.String name)
Description copied from interface:TableRowCore
Retrieve a cell based on the supplied value- Specified by:
getTableCellCore
in interfaceTableRowCore
- Parameters:
name
- Column name of the cell to be returned- Returns:
- TableCellCore object related to this row and the specified column
-
isVisible
public boolean isVisible()
Description copied from interface:TableRowCore
Retreive whether the row is visible to the user.- Specified by:
isVisible
in interfaceTableRowCore
- Returns:
- visibility state
-
setTableItem
public boolean setTableItem(int newIndex)
Description copied from interface:TableRowCore
Link the row to a SWT TableItem- Specified by:
setTableItem
in interfaceTableRowCore
- Parameters:
newIndex
- new position row should be- Returns:
- false - already linked to that item at that index
-
setSelected
public void setSelected(boolean selected)
- Specified by:
setSelected
in interfaceTableRowCore
-
isRowDisposed
public boolean isRowDisposed()
- Specified by:
isRowDisposed
in interfaceTableRowCore
-
setUpToDate
public void setUpToDate(boolean upToDate)
- Specified by:
setUpToDate
in interfaceTableRowCore
-
refresh
public java.util.List<TableCellCore> refresh(boolean bDoGraphics, boolean bVisible)
- Specified by:
refresh
in interfaceTableRowCore
- Returns:
- List of invalid cells
-
getView
public TableView getView()
- Specified by:
getView
in interfaceTableRow
- Specified by:
getView
in interfaceTableRowCore
-
addMouseListener
public void addMouseListener(TableRowMouseListener listener)
Description copied from interface:TableRow
Adds a listener that triggers when this TableRow has a mouse event.- Specified by:
addMouseListener
in interfaceTableRow
-
removeMouseListener
public void removeMouseListener(TableRowMouseListener listener)
Description copied from interface:TableRow
Remove a previously added TableRowMouseListener- Specified by:
removeMouseListener
in interfaceTableRow
- Parameters:
listener
- Previously added listener
-
invokeMouseListeners
public void invokeMouseListeners(TableRowMouseEvent event)
- Specified by:
invokeMouseListeners
in interfaceTableRowCore
-
isMouseOver
public boolean isMouseOver()
- Specified by:
isMouseOver
in interfaceTableRowCore
- Returns:
-
canExpand
public boolean canExpand()
-
isExpanded
public boolean isExpanded()
- Specified by:
isExpanded
in interfaceTableRowCore
-
setExpanded
public void setExpanded(boolean b)
- Specified by:
setExpanded
in interfaceTableRowCore
-
getParentRowCore
public TableRowCore getParentRowCore()
- Specified by:
getParentRowCore
in interfaceTableRowCore
-
getDataSource
public java.lang.Object getDataSource()
Description copied from interface:TableRow
Retrieve the data object associated with the current table row.- Specified by:
getDataSource
in interfaceTableRow
- Returns:
- The return type is dependent upon which table the cell is for:
TABLE_MYTORRENTS_*:Download
object for the current row
TABLE_TORRENT_PEERS:Peer
object for the current row
TABLE_TORRENT_FILES:DiskManagerFileInfo
object for the current row
TABLE_MYTRACKER:TrackerTorrent
object for the current row
TABLE_MYSHARES:ShareResource
object for the current row
remaining TABLE_* constants: undefined or null
-
getTableID
public java.lang.String getTableID()
Description copied from interface:TableRow
Returns which table the row is being displayed in.- Specified by:
getTableID
in interfaceTableRow
- Returns:
TableManager
.TABLE_* constant
-
setRequestAttention
public void setRequestAttention(boolean on)
- Specified by:
setRequestAttention
in interfaceTableRowCore
-
isRequestAttention
public boolean isRequestAttention()
-
isValid
public boolean isValid()
Description copied from interface:TableRow
Validility of the row's cells.
-
getTableCell
public TableCell getTableCell(java.lang.String field)
Description copied from interface:TableRow
Retrieve a cell based on its column name- Specified by:
getTableCell
in interfaceTableRow
- Parameters:
field
- Name/ID of column- Returns:
- TableCell object related to this row and the column specified
-
isSelected
public boolean isSelected()
Description copied from interface:TableRow
Retrieve whether the row is selected by the user- Specified by:
isSelected
in interfaceTableRow
- Returns:
- selection status
-
isFocused
public boolean isFocused()
-
getData
public java.lang.Object getData(java.lang.String id)
Description copied from interface:TableRow
Get a previously stored value
-
setData
public void setData(java.lang.String id, java.lang.Object data)
Description copied from interface:TableRow
Store a value against the table row
-
setIconSize
public abstract boolean setIconSize(org.eclipse.swt.graphics.Point pt)
- Specified by:
setIconSize
in interfaceTableRowSWT
-
getForeground
public abstract org.eclipse.swt.graphics.Color getForeground()
- Specified by:
getForeground
in interfaceTableRowSWT
-
getBackground
public abstract org.eclipse.swt.graphics.Color getBackground()
- Specified by:
getBackground
in interfaceTableRowSWT
-
getTableCellSWT
public TableCellSWT getTableCellSWT(java.lang.String name)
- Specified by:
getTableCellSWT
in interfaceTableRowSWT
- Returns:
-
getBounds
public abstract org.eclipse.swt.graphics.Rectangle getBounds()
- Specified by:
getBounds
in interfaceTableRowSWT
-
setBackgroundImage
public abstract void setBackgroundImage(org.eclipse.swt.graphics.Image image)
- Specified by:
setBackgroundImage
in interfaceTableRowSWT
-
getFontStyle
public int getFontStyle()
- Specified by:
getFontStyle
in interfaceTableRowSWT
- Returns:
-
setFontStyle
public boolean setFontStyle(int style)
- Specified by:
setFontStyle
in interfaceTableRowSWT
-
getAlpha
public int getAlpha()
- Specified by:
getAlpha
in interfaceTableRowSWT
- Returns:
-
setAlpha
public boolean setAlpha(int alpha)
- Specified by:
setAlpha
in interfaceTableRowSWT
-
setWidgetSelected
public abstract void setWidgetSelected(boolean selected)
- Specified by:
setWidgetSelected
in interfaceTableRowSWT
-
isShown
public boolean isShown()
- Specified by:
isShown
in interfaceTableRowSWT
-
setShown
public boolean setShown(boolean b, boolean force)
- Specified by:
setShown
in interfaceTableRowSWT
- Returns:
- true: changed
-
redraw
public void redraw()
Description copied from interface:TableRowCore
like refresh, except a different name to confuse us.- Specified by:
redraw
in interfaceTableRowCore
-
-