org.eclipse.mylar.internal.tasks.ui.wizards
Class TaskDataImportWizardPage

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.wizard.WizardPage
          extended by org.eclipse.mylar.internal.tasks.ui.wizards.TaskDataImportWizardPage
All Implemented Interfaces:
org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.wizard.IWizardPage

public class TaskDataImportWizardPage
extends org.eclipse.jface.wizard.WizardPage

Wizard Page for the Task Data Import Wizard

Author:
Wesley Coelho, Mik Kersten, Rob Elves (Adaption to Import wizard)

Field Summary
private static java.lang.String ACTIVATION_HISTORY_SETTING
           
private  org.eclipse.swt.widgets.Table backupFilesTable
           
private  org.eclipse.swt.widgets.Button browseButtonFolder
           
private  org.eclipse.swt.widgets.Button browseButtonZip
           
private static java.lang.String CONTEXTS_SETTING
           
private static java.lang.String DESCRIPTION
           
private static java.lang.String IMPORT_BACKUPMETHOD_SETTING
           
private static java.lang.String IMPORT_FOLDERMETHOD_SETTING
           
private static java.lang.String IMPORT_ZIPMETHOD_SETTING
           
private  org.eclipse.swt.widgets.Button importViaBackupButton
           
private  org.eclipse.swt.widgets.Button importViaFolderButton
           
private  org.eclipse.swt.widgets.Button importViaZipButton
           
private static java.lang.String LABEL_IMPORT_BACKUP
           
private static java.lang.String LABEL_IMPORT_FOLDER
           
private static java.lang.String LABEL_IMPORT_ZIP
           
private static java.lang.String OVERWRITE_SETTING
           
private  org.eclipse.swt.widgets.Button overwriteCheckBox
           
static java.lang.String PAGE_NAME
           
private static java.lang.String PAGE_TITLE
           
private static java.lang.String SETTINGS_SAVED
           
private static java.lang.String SOURCE_DIR_SETTING
           
private static java.lang.String SOURCE_ZIP_SETTING
           
private  org.eclipse.swt.widgets.Text sourceFolderText
           
private  org.eclipse.swt.widgets.Text sourceZipText
           
private  org.eclipse.swt.widgets.Button taskActivationHistoryCheckBox
           
private  org.eclipse.swt.widgets.Button taskContextsCheckBox
           
private static java.lang.String TASKLIST_SETTING
           
private  org.eclipse.swt.widgets.Button taskListCheckBox
           
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
TaskDataImportWizardPage()
           
 
Method Summary
private  void addBackupFileView(org.eclipse.swt.widgets.Composite composite)
           
private  void addRadioListeners()
           
 void controlChanged()
          Called to indicate that a control's value has changed
protected  org.eclipse.swt.widgets.Button createCheckBox(org.eclipse.swt.widgets.Composite parent, java.lang.String text)
          Convenience method for creating a new checkbox
private  void createContentSelectionControl(org.eclipse.swt.widgets.Composite parent)
          Create widgets for selecting the content to import
 void createControl(org.eclipse.swt.widgets.Composite parent)
           
private  void createImportBackupControl(org.eclipse.swt.widgets.Composite container)
           
private  void createImportDirectoryControl(org.eclipse.swt.widgets.Composite parent)
          Create widgets for specifying the source directory
private  void createImportFromZipControl(org.eclipse.swt.widgets.Composite parent)
          Create widgets for specifying the source zip
 java.lang.String getName()
           
 java.lang.String getSourceDirectory()
          Returns the directory where data files are to be restored from
 java.lang.String getSourceZipFile()
           
 boolean importActivationHistory()
          True if the user wants to import task activation history
 boolean importTaskContexts()
          True if the user wants to import task context files
 boolean importTaskList()
          True if the user wants to import the task list
protected  void initSettings()
          Initializes controls with values from the Dialog Settings object
 boolean overwrite()
          True if the user wants to overwrite files by default
 void saveSettings()
          Saves the control values in the dialog settings to be used as defaults the next time the page is opened
 void setParameters(boolean overwrite, boolean importTaskList, boolean importActivationHistory, boolean importTaskContexts, boolean zip, java.lang.String sourceDir, java.lang.String sourceZip)
          For testing only.
protected  boolean validate()
          Returns true if the information entered by the user is valid
 boolean zip()
          True if the user wants to import from a zip file
 
Methods inherited from class org.eclipse.jface.wizard.WizardPage
canFlipToNextPage, getContainer, getDialogSettings, getImage, getNextPage, 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, dispose, 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
dispose, getControl, getDescription, getErrorMessage, getMessage, getTitle, performHelp, setVisible
 

Field Detail

LABEL_IMPORT_FOLDER

private static final java.lang.String LABEL_IMPORT_FOLDER
See Also:
Constant Field Values

LABEL_IMPORT_ZIP

private static final java.lang.String LABEL_IMPORT_ZIP
See Also:
Constant Field Values

LABEL_IMPORT_BACKUP

private static final java.lang.String LABEL_IMPORT_BACKUP
See Also:
Constant Field Values

PAGE_TITLE

private static final java.lang.String PAGE_TITLE
See Also:
Constant Field Values

DESCRIPTION

private static final java.lang.String DESCRIPTION
See Also:
Constant Field Values

PAGE_NAME

public static final java.lang.String PAGE_NAME
See Also:
Constant Field Values

taskListCheckBox

private org.eclipse.swt.widgets.Button taskListCheckBox

taskActivationHistoryCheckBox

private org.eclipse.swt.widgets.Button taskActivationHistoryCheckBox

taskContextsCheckBox

private org.eclipse.swt.widgets.Button taskContextsCheckBox

browseButtonFolder

private org.eclipse.swt.widgets.Button browseButtonFolder

browseButtonZip

private org.eclipse.swt.widgets.Button browseButtonZip

sourceFolderText

private org.eclipse.swt.widgets.Text sourceFolderText

sourceZipText

private org.eclipse.swt.widgets.Text sourceZipText

overwriteCheckBox

private org.eclipse.swt.widgets.Button overwriteCheckBox

importViaFolderButton

private org.eclipse.swt.widgets.Button importViaFolderButton

importViaBackupButton

private org.eclipse.swt.widgets.Button importViaBackupButton

importViaZipButton

private org.eclipse.swt.widgets.Button importViaZipButton

backupFilesTable

private org.eclipse.swt.widgets.Table backupFilesTable

SETTINGS_SAVED

private static final java.lang.String SETTINGS_SAVED
See Also:
Constant Field Values

TASKLIST_SETTING

private static final java.lang.String TASKLIST_SETTING
See Also:
Constant Field Values

ACTIVATION_HISTORY_SETTING

private static final java.lang.String ACTIVATION_HISTORY_SETTING
See Also:
Constant Field Values

CONTEXTS_SETTING

private static final java.lang.String CONTEXTS_SETTING
See Also:
Constant Field Values

SOURCE_DIR_SETTING

private static final java.lang.String SOURCE_DIR_SETTING
See Also:
Constant Field Values

SOURCE_ZIP_SETTING

private static final java.lang.String SOURCE_ZIP_SETTING
See Also:
Constant Field Values

OVERWRITE_SETTING

private static final java.lang.String OVERWRITE_SETTING
See Also:
Constant Field Values

IMPORT_FOLDERMETHOD_SETTING

private static final java.lang.String IMPORT_FOLDERMETHOD_SETTING
See Also:
Constant Field Values

IMPORT_ZIPMETHOD_SETTING

private static final java.lang.String IMPORT_ZIPMETHOD_SETTING
See Also:
Constant Field Values

IMPORT_BACKUPMETHOD_SETTING

private static final java.lang.String IMPORT_BACKUPMETHOD_SETTING
See Also:
Constant Field Values
Constructor Detail

TaskDataImportWizardPage

public TaskDataImportWizardPage()
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface org.eclipse.jface.wizard.IWizardPage
Overrides:
getName in class org.eclipse.jface.wizard.WizardPage

createControl

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

addRadioListeners

private void addRadioListeners()

createContentSelectionControl

private void createContentSelectionControl(org.eclipse.swt.widgets.Composite parent)
Create widgets for selecting the content to import


createImportDirectoryControl

private void createImportDirectoryControl(org.eclipse.swt.widgets.Composite parent)
Create widgets for specifying the source directory


createImportFromZipControl

private void createImportFromZipControl(org.eclipse.swt.widgets.Composite parent)
Create widgets for specifying the source zip


createImportBackupControl

private void createImportBackupControl(org.eclipse.swt.widgets.Composite container)

addBackupFileView

private void addBackupFileView(org.eclipse.swt.widgets.Composite composite)

initSettings

protected void initSettings()
Initializes controls with values from the Dialog Settings object


saveSettings

public void saveSettings()
Saves the control values in the dialog settings to be used as defaults the next time the page is opened


createCheckBox

protected org.eclipse.swt.widgets.Button createCheckBox(org.eclipse.swt.widgets.Composite parent,
                                                        java.lang.String text)
Convenience method for creating a new checkbox


controlChanged

public void controlChanged()
Called to indicate that a control's value has changed


validate

protected boolean validate()
Returns true if the information entered by the user is valid


getSourceDirectory

public java.lang.String getSourceDirectory()
Returns the directory where data files are to be restored from


getSourceZipFile

public java.lang.String getSourceZipFile()

importTaskList

public boolean importTaskList()
True if the user wants to import the task list


importActivationHistory

public boolean importActivationHistory()
True if the user wants to import task activation history


importTaskContexts

public boolean importTaskContexts()
True if the user wants to import task context files


overwrite

public boolean overwrite()
True if the user wants to overwrite files by default


zip

public boolean zip()
True if the user wants to import from a zip file


setParameters

public void setParameters(boolean overwrite,
                          boolean importTaskList,
                          boolean importActivationHistory,
                          boolean importTaskContexts,
                          boolean zip,
                          java.lang.String sourceDir,
                          java.lang.String sourceZip)
For testing only. Sets controls to the specified values