CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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.1 2009/02/03 20:33:03 chrjones Exp $
12 //
13 
14 // system include files
15 
16 // user include files
19 
20 //
21 // constants, enums and typedefs
22 //
23 
24 //
25 // static data member definitions
26 //
27 
28 //
29 // constructors and destructor
30 //
32 m_table(iTable),
33 m_renderer(new FWColumnLabelCellRenderer),
34 m_sortedColumn(-1),
35 m_descendingSort(true)
36 {}
37 
38 // FWAdapterHeaderTableManager::FWAdapterHeaderTableManager(const FWAdapterHeaderTableManager& rhs)
39 // {
40 // // do actual copying here;
41 // }
42 
44 {
45 }
46 
47 //
48 // assignment operators
49 //
50 // const FWAdapterHeaderTableManager& FWAdapterHeaderTableManager::operator=(const FWAdapterHeaderTableManager& rhs)
51 // {
52 // //An exception safe implementation is
53 // FWAdapterHeaderTableManager temp(rhs);
54 // swap(rhs);
55 //
56 // return *this;
57 // }
58 
59 //
60 // member functions
61 //
62 void
63 FWAdapterHeaderTableManager::implSort(int col, bool sortOrder)
64 {
65  m_sortedColumn=col;
67 }
68 
69 //
70 // const member functions
71 //
72 int
74 
75 int
77 
78 int
80 {
81  return iRow;
82 }
83 
84 
85 std::vector<std::string>
87  return m_table->getTitles();
88 }
89 
91 FWAdapterHeaderTableManager::cellRenderer(int /*iRow*/, int iCol) const
92 {
93  if(iCol==m_sortedColumn) {
94  if(m_descendingSort) {
96  } else {
98  }
99  } else {
101  }
102  if(iCol < m_table->numberOfColumns()) {
103  m_renderer->setData( *(getTitles().begin()+iCol),false );
104  } else {
105  m_renderer->setData("",false);
106  }
107  return m_renderer;
108 }
109 
110 //
111 // static member functions
112 //
virtual int numberOfColumns() const =0
Number of columns in the table.
FWAdapterHeaderTableManager(const FWTableManagerBase *)
virtual int numberOfColumns() const
Number of columns in the table.
bool sortOrder(void)
The current sort order for the table.
void setSortOrder(fireworks::table::SortOrder)
virtual FWTableCellRendererBase * cellRenderer(int iRow, int iCol) const
virtual std::vector< std::string > getTitles() const
returns the title names for each column
virtual std::vector< std::string > getTitles() const =0
returns the title names for each column
FWColumnLabelCellRenderer * m_renderer
const FWTableManagerBase * m_table
void setData(const std::string &, bool isSelected)
int unsortedRowNumber(int) const
when passed the index to the sorted order of the rows it returns the original row number from the und...
#define begin
Definition: vmac.h:31
virtual void implSort(int col, bool sortOrder)
Called by &#39;sort&#39; method to actually handle the sorting of the rows. Arguments are the same as &#39;sort&#39;...
virtual int numberOfRows() const
Number of rows in the table.