CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

DataAdderTableManager Class Reference

Inheritance diagram for DataAdderTableManager:
FWTableManagerBase

List of all members.

Public Member Functions

virtual FWTableCellRendererBasecellRenderer (int iSortedRowNumber, int iCol) const
 DataAdderTableManager (FWJobMetadataManager *manager)
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.
void reset ()
virtual bool rowIsSelected (int row) const
int selectedRow () const
void setSelection (int row, int mask)
virtual void sortWithFilter (const char *filter)
virtual const std::string title () const
virtual int unsortedRowNumber (int iSortedRowNumber) const
 when passed the index to the sorted order of the rows it returns the original row number from the underlying data

Public Attributes

sigc::signal< void, int > indexSelected_

Private Member Functions

void changeSelection (int iRow)

Private Attributes

std::string m_filter
FWJobMetadataManagerm_manager
FWTextTableCellRenderer m_renderer
std::vector< int > m_row_to_index
int m_selectedRow

Detailed Description

Definition at line 72 of file FWGUIEventDataAdder.cc.


Constructor & Destructor Documentation

DataAdderTableManager::DataAdderTableManager ( FWJobMetadataManager manager) [inline]

Definition at line 74 of file FWGUIEventDataAdder.cc.

References reset().

                                                       :
      m_manager(manager), m_selectedRow(-1), m_filter() 
   {
      reset();
   }

Member Function Documentation

virtual FWTableCellRendererBase* DataAdderTableManager::cellRenderer ( int  iSortedRowNumber,
int  iCol 
) const [inline, 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 114 of file FWGUIEventDataAdder.cc.

References AlCaHLTBitMon_QueryRunRegistry::data, dataForColumn(), m_manager, m_renderer, m_row_to_index, m_selectedRow, FWTextTableCellRenderer::setData(), and FWJobMetadataManager::usableData().

   {
      
      if(static_cast<int>(m_row_to_index.size())>iSortedRowNumber) {
         int unsortedRow =  m_row_to_index[iSortedRowNumber];
         const FWJobMetadataManager::Data& data = (m_manager->usableData())[unsortedRow];

         m_renderer.setData(dataForColumn(data,iCol),m_selectedRow==unsortedRow);
      } else {
         m_renderer.setData(std::string(),false);
      }
      return &m_renderer;
   }
void DataAdderTableManager::changeSelection ( int  iRow) [inline, private]

Definition at line 160 of file FWGUIEventDataAdder.cc.

References indexSelected_, m_selectedRow, and FWTableManagerBase::visualPropertiesChanged().

Referenced by reset(), and setSelection().

                                  {
      if(iRow != m_selectedRow) {
         m_selectedRow=iRow;
         if(-1 == iRow) {
            indexSelected_(-1);
         } else {
            indexSelected_(iRow);
         }
         visualPropertiesChanged();
      }
   }
virtual std::vector<std::string> DataAdderTableManager::getTitles ( ) const [inline, virtual]

returns the title names for each column

Implements FWTableManagerBase.

Definition at line 103 of file FWGUIEventDataAdder.cc.

References kNColumns.

                                                  {
      std::vector<std::string> returnValue;
      returnValue.reserve(kNColumns);
      returnValue.push_back("Purpose");
      returnValue.push_back("Module Label");
      returnValue.push_back("Product Instance Label");
      returnValue.push_back("Process Name");
      returnValue.push_back("C++ Class");
      return returnValue;
   }
void DataAdderTableManager::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 339 of file FWGUIEventDataAdder.cc.

References m_filter, m_manager, m_row_to_index, FWTableManagerBase::sortOrder(), and FWJobMetadataManager::usableData().

{
   doSort(column, m_filter.c_str(), sortOrder, m_manager->usableData(), m_row_to_index);
}
virtual int DataAdderTableManager::numberOfColumns ( ) const [inline, virtual]

Number of columns in the table.

Implements FWTableManagerBase.

Definition at line 83 of file FWGUIEventDataAdder.cc.

References kNColumns.

                                       {
      return kNColumns;
   }
virtual int DataAdderTableManager::numberOfRows ( ) const [inline, virtual]

Number of rows in the table.

Implements FWTableManagerBase.

Definition at line 80 of file FWGUIEventDataAdder.cc.

References m_row_to_index.

                                    {
      return m_row_to_index.size();
   }
void DataAdderTableManager::reset ( void  ) [inline]
virtual bool DataAdderTableManager::rowIsSelected ( int  row) const [inline, virtual]

Definition at line 145 of file FWGUIEventDataAdder.cc.

References m_selectedRow.

                                             {
      return m_selectedRow == row;
   }
int DataAdderTableManager::selectedRow ( ) const [inline]

Definition at line 141 of file FWGUIEventDataAdder.cc.

References m_selectedRow.

                           {
      return m_selectedRow;
   }
void DataAdderTableManager::setSelection ( int  row,
int  mask 
) [inline]

Definition at line 128 of file FWGUIEventDataAdder.cc.

References changeSelection(), and m_selectedRow.

Referenced by FWGUIEventDataAdder::rowClicked().

                                         {
      if(mask == 4) {
         if( row == m_selectedRow) {
            row = -1;
         }
      }
      changeSelection(row);
   }
virtual void DataAdderTableManager::sortWithFilter ( const char *  filter) [inline, virtual]

Updates the table using the passed filter. Notice that in this case we reset the sorting and show results by those best matching the filter.

Definition at line 91 of file FWGUIEventDataAdder.cc.

References FWTableManagerBase::dataChanged(), align_tpl::filter, m_filter, FWTableManagerBase::sort(), and FWTableManagerBase::sortOrder().

Referenced by FWGUIEventDataAdder::updateFilterString().

virtual const std::string DataAdderTableManager::title ( ) const [inline, virtual]

Definition at line 137 of file FWGUIEventDataAdder.cc.

                                         {
      return "Viewable Collections";
   }
virtual int DataAdderTableManager::unsortedRowNumber ( int  iSortedRowNumber) const [inline, 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 98 of file FWGUIEventDataAdder.cc.

References m_row_to_index.

                                                             {
      return m_row_to_index[iSortedRowNumber];
   }

Member Data Documentation

sigc::signal<void,int> DataAdderTableManager::indexSelected_

Definition at line 158 of file FWGUIEventDataAdder.cc.

Referenced by changeSelection(), and FWGUIEventDataAdder::createWindow().

std::string DataAdderTableManager::m_filter [private]

Definition at line 174 of file FWGUIEventDataAdder.cc.

Referenced by implSort(), and sortWithFilter().

Definition at line 171 of file FWGUIEventDataAdder.cc.

Referenced by cellRenderer(), implSort(), and reset().

Definition at line 175 of file FWGUIEventDataAdder.cc.

Referenced by cellRenderer().

std::vector<int> DataAdderTableManager::m_row_to_index [private]