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

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.AbstractConversionRulesSelectionPage
All Implemented Interfaces:
org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.wizard.IWizardPage
Direct Known Subclasses:
GeneralConversionRulesSelectionPage

public abstract class AbstractConversionRulesSelectionPage
extends AbstractImportWizardPage

Abstract class for conversion rules selection pages of the importer wizard.

Author:
AGH CAST Team

Field Summary
protected  IImportConverter converter
          The import converter responsible for the current domain model's data conversion.
protected  Map<Class<? extends IConversionRule>,org.eclipse.swt.widgets.Combo> ruleCombosMap
          The map of existing conversion rules to the comboboxes that handle their configuration.
protected  List<ConversionRuleInfo> ruleInfos
          The conversion rules' information.
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
protected AbstractConversionRulesSelectionPage(String pageName, String description)
           
 
Method Summary
abstract  boolean canFinish()
          Checks whether the wizard can finish the import process (using the helper method isComplete()), and when it is, creates an appropriate converter, sets its conversion rule values, and sets the converter for the parent wizard.
 boolean canFlipToNextPage()
          
 void checkBlocking(IConversionRule oldRule, IConversionRule newRule, Class<? extends IConversionRule> ruleClazz)
          Checks whether the comboboxes in the curent rules selection page should be blocked or unblocked due to the change in rule selection.
 void createControl(org.eclipse.swt.widgets.Composite parent)
          
protected abstract  org.eclipse.swt.widgets.Composite createConvRulesComposite(org.eclipse.swt.widgets.Composite parent)
           
 List<TabularData> getConversionPreview(TabularData data)
          Delegated method.
 AbstractConversionRuleConfigDialog getConversionRuleConfigDialog(String ruleId)
          Retrieves conversion rule configuration dialog for conversion rule of the specified identifier.
 IConversionRule getConversionRuleInstance(String ruleId)
          Retrieves conversion rule instance with specified identifier.
 String getSelectedRuleId(org.eclipse.swt.widgets.Combo combo)
          Retrieves the conversion rule identifier selected in the specified combobox.
 void initPage()
          initPage() is invoked before showing page.
protected abstract  boolean isComplete()
          Returns whether the current conversion rule selection page is complete - whether all its obligatory conversion rules are complete (are entirely configured).
 boolean isCurrentWizardPage()
          Method is a delegate of a protected method WizardPage.isCurrentPage.
 boolean isSaveTemplateSelected()
           
abstract  void refreshCombosBlocking(List<org.eclipse.swt.widgets.Combo> combosToBlock, List<org.eclipse.swt.widgets.Combo> combosToUnblock, IConversionRule newRule)
          Refreshes the blocking of comboboxes on the current rules selection page.
abstract  void refreshConversionPreview()
          Refreshes the conversion preview table.
abstract  void refreshSelectedData()
          Method called by the previous page to refresh the selected data.
 void setMustSaveTemplate()
          This method marks flag that template from import process must be saved.
 void setRuleComboData(org.eclipse.swt.widgets.Combo convRuleCombo, Class<?> convRuleClazz)
          Sets data and items to display for the specified ombo with conversion rule implementing a specified interface class.
 void setRuleCombosMap(Map<Class<? extends IConversionRule>,org.eclipse.swt.widgets.Combo> ruleCombosMap)
           
 void setRuleDescriptionLabel(String ruleId, org.eclipse.swt.widgets.Label ruleDescriptionLbl)
          Sets the specified description label for a conversion rule with specified identifier.
abstract  int showWarningMsgBox()
          Displays a warning box before wizard finish with an appropriate message, if necessary.
 
Methods inherited from class pl.edu.agh.cast.importer.wizard.page.AbstractImportWizardPage
dispose, getImportProcess, getImportWizard, getNextPage, refreshImportData, 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
 

Field Detail

converter

protected IImportConverter converter
The import converter responsible for the current domain model's data conversion.


ruleCombosMap

protected Map<Class<? extends IConversionRule>,org.eclipse.swt.widgets.Combo> ruleCombosMap
The map of existing conversion rules to the comboboxes that handle their configuration.


ruleInfos

protected List<ConversionRuleInfo> ruleInfos
The conversion rules' information.

Constructor Detail

AbstractConversionRulesSelectionPage

protected AbstractConversionRulesSelectionPage(String pageName,
                                               String description)
Method Detail

createControl

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

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

isSaveTemplateSelected

public boolean isSaveTemplateSelected()

canFlipToNextPage

public boolean canFlipToNextPage()

Specified by:
canFlipToNextPage in interface org.eclipse.jface.wizard.IWizardPage
Overrides:
canFlipToNextPage in class AbstractImportWizardPage
See Also:
AbstractImportWizardPage.canFlipToNextPage()

setMustSaveTemplate

public void setMustSaveTemplate()
This method marks flag that template from import process must be saved.


createConvRulesComposite

protected abstract org.eclipse.swt.widgets.Composite createConvRulesComposite(org.eclipse.swt.widgets.Composite parent)

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()

isCurrentWizardPage

public boolean isCurrentWizardPage()
Method is a delegate of a protected method WizardPage.isCurrentPage. Returns whether this page is the current one in the wizard's container.

Returns:
true if the page is active, and false otherwise

checkBlocking

public void checkBlocking(IConversionRule oldRule,
                          IConversionRule newRule,
                          Class<? extends IConversionRule> ruleClazz)
Checks whether the comboboxes in the curent rules selection page should be blocked or unblocked due to the change in rule selection.

Parameters:
oldRule - the rule that had been selected previously
newRule - the rule that had been selected recently
ruleClazz - the class of the selected rule

refreshSelectedData

public abstract void refreshSelectedData()
Method called by the previous page to refresh the selected data.


refreshConversionPreview

public abstract void refreshConversionPreview()
Refreshes the conversion preview table.


refreshCombosBlocking

public abstract void refreshCombosBlocking(List<org.eclipse.swt.widgets.Combo> combosToBlock,
                                           List<org.eclipse.swt.widgets.Combo> combosToUnblock,
                                           IConversionRule newRule)
Refreshes the blocking of comboboxes on the current rules selection page.

Parameters:
combosToBlock - the comboboxes to block
combosToUnblock - the comboboxes to unblock
newRule - the newly selected conversion rule

canFinish

public abstract boolean canFinish()
Checks whether the wizard can finish the import process (using the helper method isComplete()), and when it is, creates an appropriate converter, sets its conversion rule values, and sets the converter for the parent wizard.

Returns:
true if the wizard can finish the import process, false otherwise

showWarningMsgBox

public abstract int showWarningMsgBox()
Displays a warning box before wizard finish with an appropriate message, if necessary.

Returns:
the message box result

isComplete

protected abstract boolean isComplete()
Returns whether the current conversion rule selection page is complete - whether all its obligatory conversion rules are complete (are entirely configured).

Specified by:
isComplete in class AbstractImportWizardPage
Returns:
true if the wizard can finish the import process, false otherwise

setRuleComboData

public void setRuleComboData(org.eclipse.swt.widgets.Combo convRuleCombo,
                             Class<?> convRuleClazz)
Sets data and items to display for the specified ombo with conversion rule implementing a specified interface class.

Parameters:
convRuleCombo - the combo for conversion rule
convRuleClazz - the interface class for conversion rule

getSelectedRuleId

public String getSelectedRuleId(org.eclipse.swt.widgets.Combo combo)
Retrieves the conversion rule identifier selected in the specified combobox.

Parameters:
combo - the combo, from which the selection is to be retrieved
Returns:
selected conversion rule id

setRuleDescriptionLabel

public void setRuleDescriptionLabel(String ruleId,
                                    org.eclipse.swt.widgets.Label ruleDescriptionLbl)
Sets the specified description label for a conversion rule with specified identifier.

Parameters:
ruleId - the rule identifier
ruleDescriptionLbl - the rule description label

getConversionRuleInstance

public IConversionRule getConversionRuleInstance(String ruleId)
Retrieves conversion rule instance with specified identifier.

Parameters:
ruleId - the rule id
Returns:
rule instance

getConversionRuleConfigDialog

public AbstractConversionRuleConfigDialog getConversionRuleConfigDialog(String ruleId)
Retrieves conversion rule configuration dialog for conversion rule of the specified identifier.

Parameters:
ruleId - the rule id
Returns:
rule description

setRuleCombosMap

public void setRuleCombosMap(Map<Class<? extends IConversionRule>,org.eclipse.swt.widgets.Combo> ruleCombosMap)

getConversionPreview

public List<TabularData> getConversionPreview(TabularData data)
Delegated method.

See Also:
IImportConverter.preview(List)


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