pl.edu.agh.cast.data.ui.importer.wizard
Class ImportWizard

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by pl.edu.agh.cast.data.ui.importer.wizard.ImportWizard
All Implemented Interfaces:
org.eclipse.jface.wizard.IWizard

public class ImportWizard
extends org.eclipse.jface.wizard.Wizard

The wizard which leads the users through an import data process.

Author:
AGH CAST Team

Field Summary
protected  IDataSet dataSet
          Data set into which the data will be converted during the import.
protected  FileRawDataLogger importLogger
          Observer which logs import events to file.
protected  ImportPage importPage
          First page of the import wizard: import page.
protected  boolean isPreprocessingActive
          Flag which indicates if the preprocessing page should be shown.
protected  IEntity[] mainEntities
          Main entities of the imported data.
protected  MainEntityPage mainEntityPage
          Fourth page of the import wizard: main entities page.
protected  IModel model
          Model of the imported data.
protected  String path
          Path to data file that is to be imported.
protected  PreprocessingPage preprocessingPage
          Third page of the import wizard: preprocessing page.
protected  org.eclipse.core.resources.IProject project
          The project the object belongs to.
protected  boolean status
          Status of the import wizard.
protected  Template template
          Import template.
protected  ValidationPage validationPage
          Second page of the import wizard: validation page.
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
ImportWizard(org.eclipse.core.resources.IProject project)
          The default constructor.
 
Method Summary
 void addPages()
          
 List<? extends IPreprocessingItem> analyzeDataInPreprocessing(TabularData data, Template tmpl, org.eclipse.core.runtime.IProgressMonitor monitor)
          Analyzes the specified input data and returns a list of possible changes types.
 void applyPreprocessingChanges(List<? extends IPreprocessingItem> changes, org.eclipse.core.runtime.IProgressMonitor monitor)
          Apply the specified changes to current preprocessor.
 boolean canFinish()
          
 MainEntityPage getMainEntitiesPage()
           
 org.eclipse.jface.wizard.IWizardPage getNextPage(org.eclipse.jface.wizard.IWizardPage currentPage)
          
 String getPreprocessingDescription()
          Returns the preprocessing description, or an empty string if the description was null.
 PreprocessingPage getPreprocessingPage()
           
 IImportPreprocessor getPreprocessor()
           
 org.eclipse.jface.wizard.IWizardPage getPreviousPage(org.eclipse.jface.wizard.IWizardPage currentPage)
          
 org.eclipse.core.resources.IProject getProject()
           
 ValidationPage getValidationPage()
           
 boolean isPreprocessingActive()
          Returns the isPreprocessingActive value.
 boolean performFinish()
          
 void performFirstPartOfConversion()
          Performs the first part of conversion of tabular data into IDataSet.
 void setModelUtil(ModelUtil util)
           
 void setPreprocessingActive(boolean flag)
           
 Map<DataCell,String> showPreprocessingPreview(List<? extends IPreprocessingItem> items)
          Returns proposed changes for the preprocessed items or null if either the items or the preprocessor were undefined.
 void undoPreprecessingChanges(List<? extends IPreprocessingItem> changes, org.eclipse.core.runtime.IProgressMonitor monitor)
          Undo the specified changes for current preprocessor (only if the changes were applied before).
 void validateData(TabularData data, Template tmpl, org.eclipse.core.runtime.IProgressMonitor monitor)
          Validates the specified data, according to the specified template.
 void validateRow(BrokenDataInfo errors, DataRow row)
          Validates the specified row according to the mapping of the current template.
 
Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getPage, getPageCount, getPages, getShell, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setHelpAvailable, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

importPage

protected ImportPage importPage
First page of the import wizard: import page.


validationPage

protected ValidationPage validationPage
Second page of the import wizard: validation page.


preprocessingPage

protected PreprocessingPage preprocessingPage
Third page of the import wizard: preprocessing page.


mainEntityPage

protected MainEntityPage mainEntityPage
Fourth page of the import wizard: main entities page.


isPreprocessingActive

protected boolean isPreprocessingActive
Flag which indicates if the preprocessing page should be shown.


project

protected org.eclipse.core.resources.IProject project
The project the object belongs to.


importLogger

protected FileRawDataLogger importLogger
Observer which logs import events to file.


path

protected String path
Path to data file that is to be imported.


template

protected Template template
Import template.


model

protected IModel model
Model of the imported data.


status

protected boolean status
Status of the import wizard.


dataSet

protected IDataSet dataSet
Data set into which the data will be converted during the import.


mainEntities

protected IEntity[] mainEntities
Main entities of the imported data.

Constructor Detail

ImportWizard

public ImportWizard(org.eclipse.core.resources.IProject project)
             throws org.eclipse.core.runtime.CoreException
The default constructor.

Parameters:
project - the project the object belongs to
Throws:
org.eclipse.core.runtime.CoreException
Method Detail

performFirstPartOfConversion

public void performFirstPartOfConversion()
Performs the first part of conversion of tabular data into IDataSet.


validateRow

public void validateRow(BrokenDataInfo errors,
                        DataRow row)
Validates the specified row according to the mapping of the current template. If a row is incorrect, its error statistics are updated.

Parameters:
errors - the errors information
row - the row to validate

isPreprocessingActive

public boolean isPreprocessingActive()
Returns the isPreprocessingActive value.

Returns:
true if preprocessor is loaded and it has returned not empty result; false otherwise

analyzeDataInPreprocessing

public List<? extends IPreprocessingItem> analyzeDataInPreprocessing(TabularData data,
                                                                     Template tmpl,
                                                                     org.eclipse.core.runtime.IProgressMonitor monitor)
Analyzes the specified input data and returns a list of possible changes types. If the preprocessing is active, the method initialized the preprocessing page.

Parameters:
data - the data to analyze
tmpl - the template
monitor - the progress monitor
Returns:
the possible changes

applyPreprocessingChanges

public void applyPreprocessingChanges(List<? extends IPreprocessingItem> changes,
                                      org.eclipse.core.runtime.IProgressMonitor monitor)
Apply the specified changes to current preprocessor.

Parameters:
changes - the preprocessing changes
monitor - the progress monitor

undoPreprecessingChanges

public void undoPreprecessingChanges(List<? extends IPreprocessingItem> changes,
                                     org.eclipse.core.runtime.IProgressMonitor monitor)
Undo the specified changes for current preprocessor (only if the changes were applied before).

Parameters:
changes - the preprocessing changes
monitor - the progress monitor

showPreprocessingPreview

public Map<DataCell,String> showPreprocessingPreview(List<? extends IPreprocessingItem> items)
Returns proposed changes for the preprocessed items or null if either the items or the preprocessor were undefined.

Parameters:
items - the preprocessed items
Returns:
proposed changes for items or null

getPreprocessingDescription

public String getPreprocessingDescription()
Returns the preprocessing description, or an empty string if the description was null.

Returns:
the preprocessing description, or an empty string

validateData

public void validateData(TabularData data,
                         Template tmpl,
                         org.eclipse.core.runtime.IProgressMonitor monitor)
                  throws org.eclipse.core.runtime.CoreException
Validates the specified data, according to the specified template.

Parameters:
data - the data to validate
tmpl - the template
monitor - the progress monitor
Throws:
org.eclipse.core.runtime.CoreException

addPages

public void addPages()

Specified by:
addPages in interface org.eclipse.jface.wizard.IWizard
Overrides:
addPages in class org.eclipse.jface.wizard.Wizard
See Also:
Wizard.addPages()

canFinish

public boolean canFinish()

Specified by:
canFinish in interface org.eclipse.jface.wizard.IWizard
Overrides:
canFinish in class org.eclipse.jface.wizard.Wizard
See Also:
Wizard.canFinish()

performFinish

public boolean performFinish()

Specified by:
performFinish in interface org.eclipse.jface.wizard.IWizard
Specified by:
performFinish in class org.eclipse.jface.wizard.Wizard
See Also:
Wizard.performFinish()

getNextPage

public org.eclipse.jface.wizard.IWizardPage getNextPage(org.eclipse.jface.wizard.IWizardPage currentPage)

Specified by:
getNextPage in interface org.eclipse.jface.wizard.IWizard
Overrides:
getNextPage in class org.eclipse.jface.wizard.Wizard
See Also:
Wizard.getNextPage(org.eclipse.jface.wizard.IWizardPage)

getPreviousPage

public org.eclipse.jface.wizard.IWizardPage getPreviousPage(org.eclipse.jface.wizard.IWizardPage currentPage)

Specified by:
getPreviousPage in interface org.eclipse.jface.wizard.IWizard
Overrides:
getPreviousPage in class org.eclipse.jface.wizard.Wizard
See Also:
Wizard.getPreviousPage(org.eclipse.jface.wizard.IWizardPage)

getValidationPage

public ValidationPage getValidationPage()

getPreprocessingPage

public PreprocessingPage getPreprocessingPage()

getMainEntitiesPage

public MainEntityPage getMainEntitiesPage()

getProject

public org.eclipse.core.resources.IProject getProject()

getPreprocessor

public IImportPreprocessor getPreprocessor()

setPreprocessingActive

public void setPreprocessingActive(boolean flag)

setModelUtil

public void setModelUtil(ModelUtil util)


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.