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 Object implements TableRowSWT
  • Field Details

    • DEBUG_ROW_PAINT

      public static boolean DEBUG_ROW_PAINT
    • lock

      protected final Object lock
    • tv

      private final TableViewSWT tv
    • parentRow

      private final TableRowCore parentRow
    • coreDataSource

      private final Object coreDataSource
    • lastIndex

      private int lastIndex
    • visibleRowIndex

      private int visibleRowIndex
    • mTableCells

      protected Map<String,TableCellSWTBase> mTableCells
    • bDisposed

      private boolean bDisposed
    • pluginDataSource

      private Object pluginDataSource
    • wasShown

      protected boolean wasShown
    • bSetNotUpToDateLastRefresh

      private boolean bSetNotUpToDateLastRefresh
    • mouseListeners

      private ArrayList<TableRowMouseListener> mouseListeners
    • dataList

      private Map<String,Object> dataList
    • alpha

      private int alpha
    • fontStyle

      private int fontStyle
    • expanded

      private boolean expanded
    • isAttention

      private boolean isAttention
  • Constructor Details

  • Method Details

    • invalidate

      public void invalidate()
      Description copied from interface: TableRowCore
      Invalidates Row
      Specified by:
      invalidate in interface TableRowCore
    • invalidate

      public void invalidate(boolean mustRefresh)
      Specified by:
      invalidate in interface TableRowCore
    • 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
      Don't call this directly to delete a row, it won't work - it is for internal use to allow an implementation to take action on deleting
      Specified by:
      delete in interface TableRowCore
    • refresh

      public List refresh(boolean bDoGraphics)
      Description copied from interface: TableRowCore
      Refresh all the cells in the row
      Specified by:
      refresh in interface TableRowCore
      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 interface TableRowCore
      Parameters:
      iStartColumn - Cells starting at this value may need repainting XXX Rename to cellLocationChanged?
    • getDataSource

      public Object getDataSource(boolean bCoreObject)
      Description copied from interface: TableRowCore
      Retrieve the Data Source related to this row
      Specified by:
      getDataSource in interface TableRowCore
      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 interface TableRow
      Specified by:
      getIndex in interface TableRowCore
    • setVisibleRowIndex

      public boolean setVisibleRowIndex(int index)
      Specified by:
      setVisibleRowIndex in interface TableRowCore
    • getVisibleRowIndex

      public int getVisibleRowIndex()
      Specified by:
      getVisibleRowIndex in interface TableRowCore
    • getTableCellCore

      public TableCellCore getTableCellCore(String name)
      Description copied from interface: TableRowCore
      Retrieve a cell based on the supplied value
      Specified by:
      getTableCellCore in interface TableRowCore
      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 interface TableRowCore
      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 interface TableRowCore
      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 interface TableRowCore
    • isRowDisposed

      public boolean isRowDisposed()
      Specified by:
      isRowDisposed in interface TableRowCore
    • setUpToDate

      public void setUpToDate(boolean upToDate)
      Specified by:
      setUpToDate in interface TableRowCore
    • refresh

      public List<TableCellCore> refresh(boolean bDoGraphics, boolean bVisible)
      Specified by:
      refresh in interface TableRowCore
      Returns:
      List of invalid cells
    • getView

      public TableViewSWT<?> getView()
      Specified by:
      getView in interface TableRow
      Specified by:
      getView in interface TableRowCore
      Specified by:
      getView in interface TableRowSWT
    • 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 interface TableRow
    • removeMouseListener

      public void removeMouseListener(TableRowMouseListener listener)
      Description copied from interface: TableRow
      Remove a previously added TableRowMouseListener
      Specified by:
      removeMouseListener in interface TableRow
      Parameters:
      listener - Previously added listener
    • invokeMouseListeners

      public void invokeMouseListeners(TableRowMouseEvent event)
      Specified by:
      invokeMouseListeners in interface TableRowCore
    • isMouseOver

      public boolean isMouseOver()
      Specified by:
      isMouseOver in interface TableRowCore
      Returns:
    • canExpand

      public boolean canExpand()
    • isExpanded

      public boolean isExpanded()
      Specified by:
      isExpanded in interface TableRowCore
    • setExpanded

      public void setExpanded(boolean b)
      Specified by:
      setExpanded in interface TableRowCore
    • getParentRowCore

      public TableRowCore getParentRowCore()
      Specified by:
      getParentRowCore in interface TableRowCore
    • getDataSource

      public Object getDataSource()
      Description copied from interface: TableRow
      Retrieve the data object associated with the current table row.
      Specified by:
      getDataSource in interface TableRow
      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 String getTableID()
      Description copied from interface: TableRow
      Returns which table the row is being displayed in.
      Specified by:
      getTableID in interface TableRow
      Returns:
      TableManager.TABLE_* constant
    • setRequestAttention

      public void setRequestAttention(boolean on)
      Specified by:
      setRequestAttention in interface TableRowCore
    • isRequestAttention

      public boolean isRequestAttention()
    • isValid

      public boolean isValid()
      Description copied from interface: TableRow
      Validility of the row's cells.
      Specified by:
      isValid in interface TableRow
      Returns:
      True - Text is the same as last call. You do not need to update unless you have new text to display.
      False - Cell-to-Datasource link has changed, and the text is definitely not valid.
    • getTableCell

      public TableCell getTableCell(String field)
      Description copied from interface: TableRow
      Retrieve a cell based on its column name
      Specified by:
      getTableCell in interface TableRow
      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 interface TableRow
      Returns:
      selection status
    • isFocused

      public boolean isFocused()
    • getData

      public Object getData(String id)
      Description copied from interface: TableRow
      Get a previously stored value
      Specified by:
      getData in interface TableRow
      Returns:
    • setData

      public void setData(String id, Object data)
      Description copied from interface: TableRow
      Store a value against the table row
      Specified by:
      setData in interface TableRow
    • setIconSize

      public abstract boolean setIconSize(org.eclipse.swt.graphics.Point pt)
      Specified by:
      setIconSize in interface TableRowSWT
    • getForeground

      public abstract org.eclipse.swt.graphics.Color getForeground()
      Specified by:
      getForeground in interface TableRowSWT
    • getBackground

      public abstract org.eclipse.swt.graphics.Color getBackground()
      Specified by:
      getBackground in interface TableRowSWT
    • getTableCellSWT

      public TableCellSWT getTableCellSWT(String name)
      Specified by:
      getTableCellSWT in interface TableRowSWT
      Returns:
    • getBounds

      public abstract org.eclipse.swt.graphics.Rectangle getBounds()
      Specified by:
      getBounds in interface TableRowSWT
    • setBackgroundImage

      public abstract void setBackgroundImage(org.eclipse.swt.graphics.Image image)
      Specified by:
      setBackgroundImage in interface TableRowSWT
    • getFontStyle

      public int getFontStyle()
      Specified by:
      getFontStyle in interface TableRowSWT
      Returns:
    • setFontStyle

      public boolean setFontStyle(int style)
      Specified by:
      setFontStyle in interface TableRowSWT
    • getAlpha

      public int getAlpha()
      Specified by:
      getAlpha in interface TableRowSWT
      Returns:
    • setAlpha

      public boolean setAlpha(int alpha)
      Specified by:
      setAlpha in interface TableRowSWT
    • setWidgetSelected

      public abstract void setWidgetSelected(boolean selected)
      Specified by:
      setWidgetSelected in interface TableRowSWT
    • isShown

      public boolean isShown()
      Specified by:
      isShown in interface TableRowSWT
    • setShown

      public boolean setShown(boolean b, boolean force)
      Specified by:
      setShown in interface TableRowSWT
      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 interface TableRowCore