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.3 2012/02/22 00:15:44 amraktad Exp $
12 //
13 
14 // system include files
15 
16 // user include files
19 //
20 // constants, enums and typedefs
21 //
22 
23 //
24 // static data member definitions
25 //
26 
27 //
28 // constructors and destructor
29 //
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 
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;
66 }
67 
68 //
69 // const member functions
70 //
71 int
73 
74 int
76 
77 int
79 {
80  return iRow;
81 }
82 
83 
84 std::vector<std::string>
86  return m_table->getTitles();
87 }
88 
90 FWAdapterHeaderTableManager::cellRenderer(int /*iRow*/, int iCol) const
91 {
92  if(iCol==m_sortedColumn) {
93  if(m_descendingSort) {
95  } else {
97  }
98  } else {
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 //
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.