#include <Fireworks/TableWidget/interface/FWAdapterHeaderTableManager.h>
Public Member Functions | |
virtual FWTableCellRendererBase * | cellRenderer (int iRow, int iCol) const |
FWAdapterHeaderTableManager (const FWTableManagerBase *) | |
virtual std::vector< std::string > | getTitles () const |
returns the title names for each column | |
virtual void | implSort (int col, bool sortOrder) |
Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'. | |
virtual int | numberOfColumns () const |
Number of columns in the table. | |
virtual int | numberOfRows () const |
Number of rows in the table. | |
int | unsortedRowNumber (int) const |
when passed the index to the sorted order of the rows it returns the original row number from the underlying data | |
virtual | ~FWAdapterHeaderTableManager () |
Private Member Functions | |
FWAdapterHeaderTableManager (const FWAdapterHeaderTableManager &) | |
const FWAdapterHeaderTableManager & | operator= (const FWAdapterHeaderTableManager &) |
Private Attributes | |
bool | m_descendingSort |
FWColumnLabelCellRenderer * | m_renderer |
int | m_sortedColumn |
const FWTableManagerBase * | m_table |
Description: a TableManager used to pass the header info of another table as the body of this table
Usage: This class is an implementation detail of how the FWTableWidget handles the column headers. The drawing of the column headers is done by the same widget as handles the drawing of the body. The FWAdapterHeaderTableManager is used to make the header information appear to be just another table so that it works with the above mentioned widget.
Definition at line 33 of file FWAdapterHeaderTableManager.h.
FWAdapterHeaderTableManager::FWAdapterHeaderTableManager | ( | const FWTableManagerBase * | iTable | ) |
Definition at line 30 of file FWAdapterHeaderTableManager.cc.
: m_table(iTable), m_renderer(new FWColumnLabelCellRenderer(&(FWTextTableCellRenderer::getDefaultGC()), iTable->cellDataIsSortable())), m_sortedColumn(-1), m_descendingSort(true) {}
FWAdapterHeaderTableManager::~FWAdapterHeaderTableManager | ( | ) | [virtual] |
Definition at line 42 of file FWAdapterHeaderTableManager.cc.
{ }
FWAdapterHeaderTableManager::FWAdapterHeaderTableManager | ( | const FWAdapterHeaderTableManager & | ) | [private] |
FWTableCellRendererBase * FWAdapterHeaderTableManager::cellRenderer | ( | int | iSortedRowNumber, |
int | iCol | ||
) | const [virtual] |
Returns the particular renderer used to handle the requested cell. Arguments: iSortedRowNumber: the row number from the present sort (i.e. the cell number of the view) iCol: the column number of the cell. The returned value must be used immediately and not held onto since the same Renderer can be used for subsequent calls
Implements FWTableManagerBase.
Definition at line 90 of file FWAdapterHeaderTableManager.cc.
References begin, getTitles(), fireworks::table::kAscendingSort, fireworks::table::kDescendingSort, fireworks::table::kNotSorted, m_descendingSort, m_renderer, m_sortedColumn, numberOfColumns(), FWTextTableCellRenderer::setData(), and FWColumnLabelCellRenderer::setSortOrder().
{ if(iCol==m_sortedColumn) { if(m_descendingSort) { m_renderer->setSortOrder(fireworks::table::kDescendingSort); } else { m_renderer->setSortOrder(fireworks::table::kAscendingSort); } } else { m_renderer->setSortOrder(fireworks::table::kNotSorted); } if(iCol < m_table->numberOfColumns()) { m_renderer->setData( *(getTitles().begin()+iCol),false ); } else { m_renderer->setData("",false); } return m_renderer; }
std::vector< std::string > FWAdapterHeaderTableManager::getTitles | ( | ) | const [virtual] |
returns the title names for each column
Implements FWTableManagerBase.
Definition at line 85 of file FWAdapterHeaderTableManager.cc.
References FWTableManagerBase::getTitles(), and m_table.
Referenced by cellRenderer().
void FWAdapterHeaderTableManager::implSort | ( | int | iCol, |
bool | iSortOrder | ||
) | [virtual] |
Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'.
Implements FWTableManagerBase.
Definition at line 62 of file FWAdapterHeaderTableManager.cc.
References m_descendingSort, m_sortedColumn, and FWTableManagerBase::sortOrder().
{ m_sortedColumn=col; m_descendingSort=sortOrder; }
int FWAdapterHeaderTableManager::numberOfColumns | ( | ) | const [virtual] |
Number of columns in the table.
Implements FWTableManagerBase.
Definition at line 75 of file FWAdapterHeaderTableManager.cc.
References m_table, and FWTableManagerBase::numberOfColumns().
Referenced by cellRenderer().
{ return m_table->numberOfColumns();}
int FWAdapterHeaderTableManager::numberOfRows | ( | ) | const [virtual] |
Number of rows in the table.
Implements FWTableManagerBase.
Definition at line 72 of file FWAdapterHeaderTableManager.cc.
{ return 1;}
const FWAdapterHeaderTableManager& FWAdapterHeaderTableManager::operator= | ( | const FWAdapterHeaderTableManager & | ) | [private] |
int FWAdapterHeaderTableManager::unsortedRowNumber | ( | int | iSortedRowNumber | ) | const [virtual] |
when passed the index to the sorted order of the rows it returns the original row number from the underlying data
Implements FWTableManagerBase.
Definition at line 78 of file FWAdapterHeaderTableManager.cc.
{
return iRow;
}
bool FWAdapterHeaderTableManager::m_descendingSort [private] |
Definition at line 61 of file FWAdapterHeaderTableManager.h.
Referenced by cellRenderer(), and implSort().
Definition at line 59 of file FWAdapterHeaderTableManager.h.
Referenced by cellRenderer().
int FWAdapterHeaderTableManager::m_sortedColumn [private] |
Definition at line 60 of file FWAdapterHeaderTableManager.h.
Referenced by cellRenderer(), and implSort().
const FWTableManagerBase* FWAdapterHeaderTableManager::m_table [private] |
Definition at line 58 of file FWAdapterHeaderTableManager.h.
Referenced by getTitles(), and numberOfColumns().