importer
Class ExcelImporter

java.lang.Object
  extended byimporter.ExcelImporter

public class ExcelImporter
extends java.lang.Object

Defines an importer used for importing requirements from MS Excel

Author:
Mikael Jönsson & Per Klingnäs

Field Summary
private  ExcelImporterWindow eiw
           
private  ImportWindow iw
           
private  jxl.Sheet sheet
           
private  jxl.Workbook workbook
           
 
Constructor Summary
ExcelImporter(ImportWindow iw, java.io.File excelFile, Rainbowie p)
          Constructs an ExcelImporter
 
Method Summary
 int getCols()
          Returns the number of columns in the current spreadsheet
 int getRows()
          Returns the number of rows in the current spreadsheet
 java.lang.String[] getSheets()
          Returns the names of the spreadsheets in the workbook
 void importRequirements(java.util.Vector vector, int[] indexes)
          Imports the requirements defined by the user
 void setSheet(int n)
          Sets the Excel spreadsheet to use for import
 void setupExcelImporterWindow()
          Setup the interaction window with the correct data and number of rows and columns.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

workbook

private jxl.Workbook workbook

eiw

private ExcelImporterWindow eiw

sheet

private jxl.Sheet sheet

iw

private ImportWindow iw
Constructor Detail

ExcelImporter

public ExcelImporter(ImportWindow iw,
                     java.io.File excelFile,
                     Rainbowie p)
Constructs an ExcelImporter

Parameters:
iw - the window used for user interaction during import process
excelFile - the Excel file to import from
p - reference to the programs Parseq object
Method Detail

setSheet

public void setSheet(int n)
Sets the Excel spreadsheet to use for import

Parameters:
n - the index of the spreadsheet to use

getSheets

public java.lang.String[] getSheets()
Returns the names of the spreadsheets in the workbook

Returns:
an array containg the names of the spreadsheets

getRows

public int getRows()
Returns the number of rows in the current spreadsheet

Returns:
the spreadsheets number of rows

getCols

public int getCols()
Returns the number of columns in the current spreadsheet

Returns:
the spreadsheets number of columns

setupExcelImporterWindow

public void setupExcelImporterWindow()
Setup the interaction window with the correct data and number of rows and columns.


importRequirements

public void importRequirements(java.util.Vector vector,
                               int[] indexes)
Imports the requirements defined by the user

Parameters:
vector - the data vector of the table
indexes - the index array containg information of the rows and columns where the requirements to import can be found