Overview     Modules     Class Hierarchy     Classes     Members  

Widget generating a CSVImportParameters object configuring the CSV import process. More...

#include <CSVImportConfigurationWidget.h>

Inheritance diagram for tlp::CSVImportConfigurationWidget:
Collaboration diagram for tlp::CSVImportConfigurationWidget:

Signals

void fileInfoChanged ()

Public Member Functions

 CSVImportConfigurationWidget (QWidget *parent=0)
 ~CSVImportConfigurationWidget ()
void begin ()
void line (unsigned int row, const std::vector< std::string > &lineTokens)
void end (unsigned int rowNumber, unsigned int columnNumber)
void setNewParser (tlp::CSVParser *parser)
 Update the widget contents with the new file parser.
CSVImportParameters getImportParameters () const
 Get the import parameters.
bool eventFilter (QObject *, QEvent *)
- Public Member Functions inherited from tlp::CSVContentHandler
virtual ~CSVContentHandler ()

Protected Slots

void filterPreviewLineNumber (bool filter)
void previewLineNumberChanged (int value)
void fromLineValueChanged (int value)
void toLineValueChanged (int value)
void updateTableHeaders ()
void useFirstLineAsHeaderUpdated ()
void propertyNameChanged (QString propertyName)
void propertyStateChanged (bool activated)

Protected Member Functions

void updateWidget ()
std::vector< CSVColumngetPropertiesToImport () const
void changeEvent (QEvent *e)
void updateLineNumbers (bool resetValues)
bool useFirstLineAsPropertyName () const
void setUseFirstLineAsPropertyName (bool useFirstLineAsHeader) const
unsigned int rowCount () const
unsigned int columnCount () const
unsigned int getFirstLineIndex () const
 The index of the first line to get in the file.
unsigned int getLastLineIndex () const
 The index of the last line to take in the file.
unsigned int getFirstImportedLineIndex () const
 The index of the first imported line. This index change if user use the first line as column names. The first imported line is the firstLineIndex but with the By example if user want to import all lines but use the first line as column names this funnction will return 1 not 0.
void clearPropertiesTypeList ()
void addPropertyToPropertyList (const std::string &propertyName, bool isEditable, const std::string &propertyType=std::string(""))
virtual
PropertyConfigurationWidget
createPropertyConfigurationWidget (unsigned int propertyNumber, const QString &propertyName, bool propertyNameIsEditable, const std::string &propertyType, QWidget *parent)
 Creates a property configuration widget.
QString genrateColumnName (unsigned int col) const
 Compute the name of the column. Return the first token fo the column if the first lline is used as header r Column_x xhere x is the column index.
std::string getColumnType (unsigned int col) const
 Compute the column data type. Take in account the first row only if it is not used as column label.

Protected Attributes

std::vector
< PropertyConfigurationWidget * > 
propertyWidgets

Detailed Description

Widget generating a CSVImportParameters object configuring the CSV import process.

Use a CSV parser to fill this widget with previews and CSV file statistics like number of rows and columns.

Constructor & Destructor Documentation

tlp::CSVImportConfigurationWidget::CSVImportConfigurationWidget ( QWidget *  parent = 0)
tlp::CSVImportConfigurationWidget::~CSVImportConfigurationWidget ( )

Member Function Documentation

void tlp::CSVImportConfigurationWidget::addPropertyToPropertyList ( const std::string &  propertyName,
bool  isEditable,
const std::string &  propertyType = std::string("") 
)
protected

Add a property to the current property list.

void tlp::CSVImportConfigurationWidget::begin ( )
virtual

Function called at the beginning of the file parsing.

Implements tlp::CSVContentHandler.

void tlp::CSVImportConfigurationWidget::changeEvent ( QEvent *  e)
protected
void tlp::CSVImportConfigurationWidget::clearPropertiesTypeList ( )
protected

Empty the properties list.

unsigned int tlp::CSVImportConfigurationWidget::columnCount ( ) const
protected
virtual PropertyConfigurationWidget* tlp::CSVImportConfigurationWidget::createPropertyConfigurationWidget ( unsigned int  propertyNumber,
const QString &  propertyName,
bool  propertyNameIsEditable,
const std::string &  propertyType,
QWidget *  parent 
)
protectedvirtual

Creates a property configuration widget.

Parameters
propertyNumberThe property number.
propertyNameThe name of the property.
propertyNameIsEditableWhether the property's name is editable.
propertyTypeThe type of the property.
parentThis widget's parent.
Returns
:PropertyConfigurationWidget*
void tlp::CSVImportConfigurationWidget::end ( unsigned int  rowNumber,
unsigned int  columnNumber 
)
virtual

Function called at the end of the parsing.

Parameters
rowNumberthe number of row read in the file.
columnNumberThe column number for the line with the greatest column number.

Implements tlp::CSVContentHandler.

bool tlp::CSVImportConfigurationWidget::eventFilter ( QObject *  ,
QEvent *   
)
void tlp::CSVImportConfigurationWidget::fileInfoChanged ( )
signal
void tlp::CSVImportConfigurationWidget::filterPreviewLineNumber ( bool  filter)
protectedslot
void tlp::CSVImportConfigurationWidget::fromLineValueChanged ( int  value)
protectedslot
QString tlp::CSVImportConfigurationWidget::genrateColumnName ( unsigned int  col) const
protected

Compute the name of the column. Return the first token fo the column if the first lline is used as header r Column_x xhere x is the column index.

std::string tlp::CSVImportConfigurationWidget::getColumnType ( unsigned int  col) const
protected

Compute the column data type. Take in account the first row only if it is not used as column label.

unsigned int tlp::CSVImportConfigurationWidget::getFirstImportedLineIndex ( ) const
protected

The index of the first imported line. This index change if user use the first line as column names. The first imported line is the firstLineIndex but with the By example if user want to import all lines but use the first line as column names this funnction will return 1 not 0.

unsigned int tlp::CSVImportConfigurationWidget::getFirstLineIndex ( ) const
protected

The index of the first line to get in the file.

A line number from 0 to LastLineIndex.

CSVImportParameters tlp::CSVImportConfigurationWidget::getImportParameters ( ) const

Get the import parameters.

Use this object to configure import process of the CSVImportGraph object.

unsigned int tlp::CSVImportConfigurationWidget::getLastLineIndex ( ) const
protected

The index of the last line to take in the file.

std::vector<CSVColumn> tlp::CSVImportConfigurationWidget::getPropertiesToImport ( ) const
protected
void tlp::CSVImportConfigurationWidget::line ( unsigned int  row,
const std::vector< std::string > &  lineTokens 
)
virtual

Function called for each line in the file.

Parameters
rowThe number of the row.
lineTokensThe tokens.

Implements tlp::CSVContentHandler.

void tlp::CSVImportConfigurationWidget::previewLineNumberChanged ( int  value)
protectedslot
void tlp::CSVImportConfigurationWidget::propertyNameChanged ( QString  propertyName)
protectedslot
void tlp::CSVImportConfigurationWidget::propertyStateChanged ( bool  activated)
protectedslot
unsigned int tlp::CSVImportConfigurationWidget::rowCount ( ) const
protected
void tlp::CSVImportConfigurationWidget::setNewParser ( tlp::CSVParser parser)

Update the widget contents with the new file parser.

void tlp::CSVImportConfigurationWidget::setUseFirstLineAsPropertyName ( bool  useFirstLineAsHeader) const
protected
void tlp::CSVImportConfigurationWidget::toLineValueChanged ( int  value)
protectedslot
void tlp::CSVImportConfigurationWidget::updateLineNumbers ( bool  resetValues)
protected
void tlp::CSVImportConfigurationWidget::updateTableHeaders ( )
protectedslot
void tlp::CSVImportConfigurationWidget::updateWidget ( )
protected
void tlp::CSVImportConfigurationWidget::useFirstLineAsHeaderUpdated ( )
protectedslot
bool tlp::CSVImportConfigurationWidget::useFirstLineAsPropertyName ( ) const
protected

Member Data Documentation

std::vector<PropertyConfigurationWidget*> tlp::CSVImportConfigurationWidget::propertyWidgets
protected


Tulip Software by LaBRI Visualization Team    2001 - 2012