pl.edu.agh.cast.importer.wizard.page
Class FileParamsSelectionPage

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.wizard.WizardPage
          extended by pl.edu.agh.cast.importer.wizard.page.AbstractImportWizardPage
              extended by pl.edu.agh.cast.importer.wizard.page.FileParamsSelectionPage
All Implemented Interfaces:
org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.wizard.IWizardPage

public class FileParamsSelectionPage
extends AbstractImportWizardPage

Page of the import wizard, which serves for initial selection of all basic information that are required by the import process, such as selection of the data file format, domain model and encoding.

Author:
AGH CAST Team

Field Summary
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
FileParamsSelectionPage()
          The default constructor.
 
Method Summary
 void createControl(org.eclipse.swt.widgets.Composite parent)
          
 Map<String,String> getAllSupportedFileExtensions()
          Retrieves all file extensions supported by all tokenizers, mapped to their tokenizer's identifiers.
 Charset getFileCharset()
          Retrieves the charset for selected file, on the basis of selected file format (tokenizer).
 IImportTokenizer getTokenizer()
           
 String getTokenizerDescription(String tokenizerId)
          Retrieves description of a tokenizer of the specified identifier.
 void initPage()
          initPage() is invoked before showing page.
protected  boolean isComplete()
           
 RawTabularData loadPreview(Charset fileEncoding, List<ITokenizerOption> tokenizerOptions, int previewRowsLimit)
          Loads a data preview by importing a given amount of rows (PREVIEW_ROWS_LIMIT) of a specified data file, with use of a tokenizer of a specified identifier and its options.
 void refreshImportData()
          refrestImportData() is invoked before page leaving.
 void setDomainModelComboData(org.eclipse.swt.widgets.Combo domainModelCombo)
          Sets data and items to display for the domain model combo on InitImportPageComposite.
 void setFormatComboData(org.eclipse.swt.widgets.Combo fileFormatCombo)
          Sets data and items to display for the file format combo on InitImportPageComposite.
 void setSelectedEncoding(Charset charset)
          Sets the selected encoding.
 
Methods inherited from class pl.edu.agh.cast.importer.wizard.page.AbstractImportWizardPage
canFlipToNextPage, dispose, getImportProcess, getImportWizard, getNextPage, widgetModified
 
Methods inherited from class org.eclipse.jface.wizard.WizardPage
getContainer, getDialogSettings, getImage, getName, getPreviousPage, getShell, getWizard, isCurrentPage, isPageComplete, setDescription, setErrorMessage, setImageDescriptor, setMessage, setPageComplete, setPreviousPage, setTitle, setWizard, toString
 
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getMessage, getMessageType, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, performHelp, setButtonLayoutData, setControl, setMessage, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
getControl, getDescription, getErrorMessage, getMessage, getTitle, performHelp, setVisible
 

Constructor Detail

FileParamsSelectionPage

public FileParamsSelectionPage()
The default constructor.

Method Detail

createControl

public void createControl(org.eclipse.swt.widgets.Composite parent)

See Also:
IDialogPage.createControl(org.eclipse.swt.widgets.Composite)

isComplete

protected boolean isComplete()
Specified by:
isComplete in class AbstractImportWizardPage

initPage

public void initPage()
initPage() is invoked before showing page. Should be used to initialise page data (e.g. previews, combo fields).

Overrides:
initPage in class AbstractImportWizardPage
See Also:
AbstractImportWizardPage.initPage()

refreshImportData

public void refreshImportData()
refrestImportData() is invoked before page leaving. Here actual information about import process from this page should be set in import process.

Overrides:
refreshImportData in class AbstractImportWizardPage
See Also:
AbstractImportWizardPage.refreshImportData()

loadPreview

public RawTabularData loadPreview(Charset fileEncoding,
                                  List<ITokenizerOption> tokenizerOptions,
                                  int previewRowsLimit)
Loads a data preview by importing a given amount of rows (PREVIEW_ROWS_LIMIT) of a specified data file, with use of a tokenizer of a specified identifier and its options.

TODO: now the method loads a preview of only a single tabular data; future versions must include tabs for every tokenized tabular data

Parameters:
fileEncoding - the file selected file encoding
tokenizerOptions - the options for the tokenizer
previewRowsLimit - the limit of rows previewed
Returns:
the raw tabular data ready for preview

setDomainModelComboData

public void setDomainModelComboData(org.eclipse.swt.widgets.Combo domainModelCombo)
Sets data and items to display for the domain model combo on InitImportPageComposite.

Parameters:
domainModelCombo - the domain model combo

setFormatComboData

public void setFormatComboData(org.eclipse.swt.widgets.Combo fileFormatCombo)
Sets data and items to display for the file format combo on InitImportPageComposite.

Parameters:
fileFormatCombo - the file format combo

getTokenizerDescription

public String getTokenizerDescription(String tokenizerId)
Retrieves description of a tokenizer of the specified identifier.

Parameters:
tokenizerId - the tokenizer id
Returns:
tokenizer description

getAllSupportedFileExtensions

public Map<String,String> getAllSupportedFileExtensions()
Retrieves all file extensions supported by all tokenizers, mapped to their tokenizer's identifiers.

Returns:
all supported file extensions mappings

getFileCharset

public Charset getFileCharset()
Retrieves the charset for selected file, on the basis of selected file format (tokenizer).

Returns:
the file charset

setSelectedEncoding

public void setSelectedEncoding(Charset charset)
Sets the selected encoding.

Parameters:
charset - the selected encoding

getTokenizer

public IImportTokenizer getTokenizer()


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