Class AbstractDtImportWizardPage

  • All Implemented Interfaces:
    IImportWizardPage, org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.wizard.IWizardPage

    public abstract class AbstractDtImportWizardPage
    extends org.eclipse.jface.wizard.WizardPage
    implements IImportWizardPage
    Abstract impmenetation of DT project import page. Allows to configure source folder and project name.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractDtImportWizardPage​(String pageName)
      Creates a new wizard page with the given name, and with no title or image.
        AbstractDtImportWizardPage​(String pageName, String title, org.eclipse.jface.resource.ImageDescriptor titleImage)
      Creates a new wizard page with the given name, title, and image.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void bindPageArea()
      Binds page area controls.
      protected ComboViewer createBaseProjectComponents​(org.eclipse.swt.widgets.Composite parent)
      Create combobox control for select base project
      void createControl​(org.eclipse.swt.widgets.Composite parent)  
      protected org.eclipse.swt.widgets.Composite createPageArea​(org.eclipse.swt.widgets.Composite parent)
      Creates page area controls.
      protected org.eclipse.swt.widgets.Combo createSourcePathCombo​(org.eclipse.swt.widgets.Composite parent)
      Create combobox control for select path to import source
      protected org.eclipse.swt.widgets.Text createTargetProjectNameText​(org.eclipse.swt.widgets.Composite parent)
      Create text control for enter project name.
      protected ComboViewer createVersionComboViewer​(org.eclipse.swt.widgets.Composite parent)
      Create combobox control for select 1C Runtime version.
      protected abstract org.eclipse.core.runtime.IStatus executeImport​(String projectName)
      Execute configured import operation.
      org.eclipse.core.runtime.IStatus finish()
      Execute configured import operation.
      protected String getCreatingProjectName()
      Returns the name of the project to create or null if not set.
      protected void openErrorDialog​(String message)
      Opens error dialog with the provided message content.
      protected void openErrorDialog​(Throwable exception)
      Opens error dialog with the provided exception content.
      protected boolean openQuestionDialog​(String message)
      Opens question dialog with the provided message content.
      protected String openSourceBrowseDialog()
      Opens source browse dialog.
      protected boolean removeExistProject()
      Delete exist project if it already exists
      protected void sourceDirectoryPostSelected​(String selectedDirectory)
      Method to update ui controls after selection a new source path in browse dialog.
      protected boolean validatePage()
      Validates import page.
      • Methods inherited from class org.eclipse.jface.wizard.WizardPage

        canFlipToNextPage, getContainer, getDialogSettings, getImage, getName, 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 interface org.eclipse.jface.dialogs.IDialogPage

        dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisible
      • Methods inherited from interface org.eclipse.jface.wizard.IWizardPage

        canFlipToNextPage, getName, getNextPage, getPreviousPage, getWizard, isPageComplete, setPreviousPage, setWizard
    • Field Detail

      • v8projectManagerProvider

        @Inject
        protected com.google.inject.Provider<IV8ProjectManager> v8projectManagerProvider
      • importServiceRegistryProvider

        @Inject
        protected com.google.inject.Provider<IImportServiceRegistry> importServiceRegistryProvider
      • previouslyBrowsedDirectory

        protected String previouslyBrowsedDirectory
      • projectName

        protected String projectName
      • sourcePath

        protected String sourcePath
      • sourcePathCombo

        protected org.eclipse.swt.widgets.Combo sourcePathCombo
      • browseSourceButton

        protected org.eclipse.swt.widgets.Button browseSourceButton
      • projectNameText

        protected org.eclipse.swt.widgets.Text projectNameText
    • Constructor Detail

      • AbstractDtImportWizardPage

        protected AbstractDtImportWizardPage​(String pageName)
        Creates a new wizard page with the given name, and with no title or image.
        Parameters:
        pageName - the name of the page, cannot be null
      • AbstractDtImportWizardPage

        public AbstractDtImportWizardPage​(String pageName,
                                          String title,
                                          org.eclipse.jface.resource.ImageDescriptor titleImage)
        Creates a new wizard page with the given name, title, and image.
        Parameters:
        pageName - the name of the page, cannot be null
        title - the title for this wizard page, or null if none
        titleImage - the image descriptor for the title of this wizard page, or null if none
    • Method Detail

      • createControl

        public void createControl​(org.eclipse.swt.widgets.Composite parent)
        Specified by:
        createControl in interface org.eclipse.jface.dialogs.IDialogPage
      • finish

        public org.eclipse.core.runtime.IStatus finish()
        Description copied from interface: IImportWizardPage
        Execute configured import operation. Returns import execution status:
        • OK status if import was successful.
        • CANCEL status if import was cancelled.
        • ERROR status with exception and error description if an error was occurred.
        Specified by:
        finish in interface IImportWizardPage
        Returns:
        the status of execution, never null
      • executeImport

        protected abstract org.eclipse.core.runtime.IStatus executeImport​(String projectName)
        Execute configured import operation. Returns import execution status:
        • OK status if import was successful.
        • CANCEL status if import was cancelled.
        • ERROR status with exception and error description if an error was occurred.
        Parameters:
        projectName - the configured project name, cannot be null
        Returns:
        returns executed import status, never null
      • removeExistProject

        protected boolean removeExistProject()
        Delete exist project if it already exists
        Returns:
        true the project will be removed, false not.
      • getCreatingProjectName

        protected String getCreatingProjectName()
        Returns the name of the project to create or null if not set.
        Returns:
        the name of the project to create or null if not set
      • createPageArea

        protected org.eclipse.swt.widgets.Composite createPageArea​(org.eclipse.swt.widgets.Composite parent)
        Creates page area controls.
        Parameters:
        parent - the parent composite, cannot be null
      • createSourcePathCombo

        protected org.eclipse.swt.widgets.Combo createSourcePathCombo​(org.eclipse.swt.widgets.Composite parent)
        Create combobox control for select path to import source
        Parameters:
        parent - the parent composite, cannot be null
        Returns:
        instance of new Combo control, never null
      • createTargetProjectNameText

        protected org.eclipse.swt.widgets.Text createTargetProjectNameText​(org.eclipse.swt.widgets.Composite parent)
        Create text control for enter project name.
        Parameters:
        parent - the parent composite, cannot be null
        Returns:
        instance of new Text control, never null
      • createVersionComboViewer

        protected ComboViewer createVersionComboViewer​(org.eclipse.swt.widgets.Composite parent)
        Create combobox control for select 1C Runtime version.
        Parameters:
        parent - the parent composite, cannot be null
        Returns:
        instance of new ComboViewer, never null
      • createBaseProjectComponents

        protected ComboViewer createBaseProjectComponents​(org.eclipse.swt.widgets.Composite parent)
        Create combobox control for select base project
        Parameters:
        parent - the parent composite, cannot be null
        Returns:
        instance of new ComboViewer, never null
      • bindPageArea

        protected void bindPageArea()
        Binds page area controls. Method is executed after page area controls creation.
      • validatePage

        protected boolean validatePage()
        Validates import page. Returns whether the page is valid and import may be performed.
        Returns:
        whether the page is valid and import may be performed
      • openSourceBrowseDialog

        protected String openSourceBrowseDialog()
        Opens source browse dialog. Returns selected directory.
        Returns:
        the selected directory path as String or null if none
      • sourceDirectoryPostSelected

        protected void sourceDirectoryPostSelected​(String selectedDirectory)
        Method to update ui controls after selection a new source path in browse dialog.
        Parameters:
        selectedDirectory - a new selected directory path, cannot be null
      • openErrorDialog

        protected void openErrorDialog​(String message)
        Opens error dialog with the provided message content.
        Parameters:
        message - the error message, cannot be null
      • openErrorDialog

        protected void openErrorDialog​(Throwable exception)
        Opens error dialog with the provided exception content.
        Parameters:
        exception - the error, cannot be null
      • openQuestionDialog

        protected boolean openQuestionDialog​(String message)
        Opens question dialog with the provided message content. Returns user answer result.
        Parameters:
        message - the question message, cannot be null
        Returns:
        user answer result