Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
Fireworks
TableWidget
src
FWAdapterHeaderTableManager.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: TableWidget
4
// Class : FWAdapterHeaderTableManager
5
//
6
// Implementation:
7
// <Notes on implementation>
8
//
9
// Original Author: Chris Jones
10
// Created: Mon Feb 2 16:44:45 EST 2009
11
// $Id: FWAdapterHeaderTableManager.cc,v 1.3 2012/02/22 00:15:44 amraktad Exp $
12
//
13
14
// system include files
15
16
// user include files
17
#include "
Fireworks/TableWidget/src/FWAdapterHeaderTableManager.h
"
18
#include "
Fireworks/TableWidget/interface/FWColumnLabelCellRenderer.h
"
19
//
20
// constants, enums and typedefs
21
//
22
23
//
24
// static data member definitions
25
//
26
27
//
28
// constructors and destructor
29
//
30
FWAdapterHeaderTableManager::FWAdapterHeaderTableManager
(
const
FWTableManagerBase
* iTable) :
31
m_table(iTable),
32
m_renderer(new
FWColumnLabelCellRenderer
(&(
FWTextTableCellRenderer
::getDefaultGC()), iTable->cellDataIsSortable())),
33
m_sortedColumn(-1),
34
m_descendingSort(
true
)
35
{}
36
37
// FWAdapterHeaderTableManager::FWAdapterHeaderTableManager(const FWAdapterHeaderTableManager& rhs)
38
// {
39
// // do actual copying here;
40
// }
41
42
FWAdapterHeaderTableManager::~FWAdapterHeaderTableManager
()
43
{
44
}
45
46
//
47
// assignment operators
48
//
49
// const FWAdapterHeaderTableManager& FWAdapterHeaderTableManager::operator=(const FWAdapterHeaderTableManager& rhs)
50
// {
51
// //An exception safe implementation is
52
// FWAdapterHeaderTableManager temp(rhs);
53
// swap(rhs);
54
//
55
// return *this;
56
// }
57
58
//
59
// member functions
60
//
61
void
62
FWAdapterHeaderTableManager::implSort
(
int
col,
bool
sortOrder)
63
{
64
m_sortedColumn
=col;
65
m_descendingSort
=
sortOrder
;
66
}
67
68
//
69
// const member functions
70
//
71
int
72
FWAdapterHeaderTableManager::numberOfRows
()
const
{
return
1;}
73
74
int
75
FWAdapterHeaderTableManager::numberOfColumns
()
const
{
return
m_table
->
numberOfColumns
();}
76
77
int
78
FWAdapterHeaderTableManager::unsortedRowNumber
(
int
iRow)
const
79
{
80
return
iRow;
81
}
82
83
84
std::vector<std::string>
85
FWAdapterHeaderTableManager::getTitles
()
const
{
86
return
m_table
->
getTitles
();
87
}
88
89
FWTableCellRendererBase
*
90
FWAdapterHeaderTableManager::cellRenderer
(
int
/*iRow*/
,
int
iCol)
const
91
{
92
if
(iCol==
m_sortedColumn
) {
93
if
(
m_descendingSort
) {
94
m_renderer
->
setSortOrder
(
fireworks::table::kDescendingSort
);
95
}
else
{
96
m_renderer
->
setSortOrder
(
fireworks::table::kAscendingSort
);
97
}
98
}
else
{
99
m_renderer
->
setSortOrder
(
fireworks::table::kNotSorted
);
100
}
101
if
(iCol < m_table->
numberOfColumns
()) {
102
m_renderer
->
setData
( *(
getTitles
().
begin
()+iCol),
false
);
103
}
else
{
104
m_renderer
->
setData
(
""
,
false
);
105
}
106
return
m_renderer
;
107
}
108
109
//
110
// static member functions
111
//
FWTableManagerBase::numberOfColumns
virtual int numberOfColumns() const =0
Number of columns in the table.
FWAdapterHeaderTableManager::FWAdapterHeaderTableManager
FWAdapterHeaderTableManager(const FWTableManagerBase *)
Definition:
FWAdapterHeaderTableManager.cc:30
FWAdapterHeaderTableManager::numberOfColumns
virtual int numberOfColumns() const
Number of columns in the table.
Definition:
FWAdapterHeaderTableManager.cc:75
FWTableManagerBase::sortOrder
bool sortOrder(void)
The current sort order for the table.
Definition:
FWTableManagerBase.h:106
FWColumnLabelCellRenderer::setSortOrder
void setSortOrder(fireworks::table::SortOrder)
Definition:
FWColumnLabelCellRenderer.cc:81
FWAdapterHeaderTableManager::cellRenderer
virtual FWTableCellRendererBase * cellRenderer(int iRow, int iCol) const
Definition:
FWAdapterHeaderTableManager.cc:90
FWColumnLabelCellRenderer
Definition:
FWColumnLabelCellRenderer.h:31
FWAdapterHeaderTableManager::getTitles
virtual std::vector< std::string > getTitles() const
returns the title names for each column
Definition:
FWAdapterHeaderTableManager.cc:85
fireworks::table::kNotSorted
Definition:
SortOrder.h:30
FWTableManagerBase::getTitles
virtual std::vector< std::string > getTitles() const =0
returns the title names for each column
FWAdapterHeaderTableManager::m_renderer
FWColumnLabelCellRenderer * m_renderer
Definition:
FWAdapterHeaderTableManager.h:59
FWTableManagerBase
Definition:
FWTableManagerBase.h:45
FWTextTableCellRenderer
Definition:
FWTextTableCellRenderer.h:33
funct::true
true
Definition:
Factorize.h:183
FWAdapterHeaderTableManager::m_sortedColumn
int m_sortedColumn
Definition:
FWAdapterHeaderTableManager.h:60
FWAdapterHeaderTableManager::m_table
const FWTableManagerBase * m_table
Definition:
FWAdapterHeaderTableManager.h:58
FWTableCellRendererBase
Definition:
FWTableCellRendererBase.h:45
fireworks::table::kAscendingSort
Definition:
SortOrder.h:30
fireworks::table::kDescendingSort
Definition:
SortOrder.h:30
FWTextTableCellRenderer::setData
void setData(const std::string &, bool isSelected)
Definition:
FWTextTableCellRenderer.cc:106
FWAdapterHeaderTableManager::~FWAdapterHeaderTableManager
virtual ~FWAdapterHeaderTableManager()
Definition:
FWAdapterHeaderTableManager.cc:42
FWAdapterHeaderTableManager.h
FWAdapterHeaderTableManager::unsortedRowNumber
int unsortedRowNumber(int) const
when passed the index to the sorted order of the rows it returns the original row number from the und...
Definition:
FWAdapterHeaderTableManager.cc:78
begin
#define begin
Definition:
vmac.h:31
FWAdapterHeaderTableManager::implSort
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'...
Definition:
FWAdapterHeaderTableManager.cc:62
FWAdapterHeaderTableManager::m_descendingSort
bool m_descendingSort
Definition:
FWAdapterHeaderTableManager.h:61
FWColumnLabelCellRenderer.h
FWAdapterHeaderTableManager::numberOfRows
virtual int numberOfRows() const
Number of rows in the table.
Definition:
FWAdapterHeaderTableManager.cc:72
Generated for CMSSW Reference Manual by
1.8.5