Class AbstractLaunchingTab

  • All Implemented Interfaces:
    com._1c.g5.v8.dt.internal.launching.ui.launchconfigurations.IRuntimeClientChangeListener, IInfobaseAccessSettingsChangeListener, EventListener, org.eclipse.debug.core.IPrototypeAttributesLabelProvider, org.eclipse.debug.ui.ILaunchConfigurationTab, org.eclipse.debug.ui.ILaunchConfigurationTab2, ISelectionChangedListener, org.eclipse.swt.events.ModifyListener, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.internal.SWTEventListener

    public abstract class AbstractLaunchingTab
    extends com._1c.g5.v8.dt.internal.launching.ui.launchconfigurations.AbstractRuntimeClientTab
    implements org.eclipse.swt.events.ModifyListener, org.eclipse.swt.events.SelectionListener, ISelectionChangedListener, IInfobaseAccessSettingsChangeListener
    Abstract launch configuration tab with target project selection, infobase selection and 1C:Enterprise runtime installation selection.
    • Field Detail

      • useDefaultAssociationInfobaseLaunch

        protected org.eclipse.swt.widgets.Button useDefaultAssociationInfobaseLaunch
      • useSelectedInfobaseLaunch

        protected org.eclipse.swt.widgets.Button useSelectedInfobaseLaunch
      • addInfobase

        protected org.eclipse.swt.widgets.Button addInfobase
      • installationViewer

        protected ComboViewer installationViewer
      • updateBeforeLaunch

        protected org.eclipse.swt.widgets.Button updateBeforeLaunch
      • loadFullConfiguration

        protected org.eclipse.swt.widgets.Button loadFullConfiguration
      • associateAfterUpdate

        protected org.eclipse.swt.widgets.Button associateAfterUpdate
      • runtimeTypeId

        protected String runtimeTypeId
      • runtimewizardId

        protected String runtimewizardId
    • Constructor Detail

      • AbstractLaunchingTab

        public AbstractLaunchingTab​(String runtimeTypeId,
                                    String runtimewizardId)
        Creates an instance of AbstractLaunchingTab.
        Parameters:
        runtimeTypeId - the 1C:Enterprise installation type id, cannot be null
        runtimewizardId - the 1C:Enterprise installation wizard id, cannot be null
    • Method Detail

      • setDefaults

        public void setDefaults​(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
        Specified by:
        setDefaults in interface org.eclipse.debug.ui.ILaunchConfigurationTab
      • initializeFrom

        public void initializeFrom​(org.eclipse.debug.core.ILaunchConfiguration configuration)
        Specified by:
        initializeFrom in interface org.eclipse.debug.ui.ILaunchConfigurationTab
        Overrides:
        initializeFrom in class com._1c.g5.v8.dt.internal.launching.ui.launchconfigurations.AbstractRuntimeClientTab
      • deactivated

        public void deactivated​(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy workingCopy)
        Specified by:
        deactivated in interface org.eclipse.debug.ui.ILaunchConfigurationTab
        Overrides:
        deactivated in class org.eclipse.debug.ui.AbstractLaunchConfigurationTab
      • isValid

        public boolean isValid​(org.eclipse.debug.core.ILaunchConfiguration launchConfig)
        Specified by:
        isValid in interface org.eclipse.debug.ui.ILaunchConfigurationTab
        Overrides:
        isValid in class org.eclipse.debug.ui.AbstractLaunchConfigurationTab
      • modifyText

        public void modifyText​(org.eclipse.swt.events.ModifyEvent e)
        Specified by:
        modifyText in interface org.eclipse.swt.events.ModifyListener
      • widgetSelected

        public void widgetSelected​(org.eclipse.swt.events.SelectionEvent e)
        Specified by:
        widgetSelected in interface org.eclipse.swt.events.SelectionListener
      • widgetDefaultSelected

        public void widgetDefaultSelected​(org.eclipse.swt.events.SelectionEvent e)
        Specified by:
        widgetDefaultSelected in interface org.eclipse.swt.events.SelectionListener
      • dispose

        public void dispose()
        Specified by:
        dispose in interface org.eclipse.debug.ui.ILaunchConfigurationTab
        Overrides:
        dispose in class org.eclipse.debug.ui.AbstractLaunchConfigurationTab
      • initializeInfobaseSettings

        protected Optional<InfobaseReference> initializeInfobaseSettings​(org.eclipse.debug.core.ILaunchConfiguration configuration,
                                                                         org.eclipse.core.resources.IProject project)
                                                                  throws org.eclipse.core.runtime.CoreException
        Initialize launch infobase UI settings based on the provided launch configuration.
        Parameters:
        configuration - the launch configuration to use, cannot be null
        project - the project to use, cannot be null
        Returns:
        the selected infobase to launch or none if not selected
        Throws:
        org.eclipse.core.runtime.CoreException - if configuration read error occurred
      • createProjectSettings

        protected void createProjectSettings​(org.eclipse.swt.widgets.Composite parent)
        Create project settings UI elements.
        Parameters:
        parent - parent composite to create on, cannot be null
      • handleProjectSelection

        protected void handleProjectSelection​(org.eclipse.core.resources.IProject project)
        Handles a project selection.
        Parameters:
        project - the selected project, cannot be null
      • createInfobaseSettings

        protected void createInfobaseSettings​(org.eclipse.swt.widgets.Composite parent)
        Creates infobase settings UI elements.
        Parameters:
        parent - the parent composite to create on, cannot be null
      • handleUseDefaultInfobaseLaunchSelection

        protected void handleUseDefaultInfobaseLaunchSelection()
        Handles use default infobase launch button selection.
      • handleUseInfobaseLaunchSelection

        protected void handleUseInfobaseLaunchSelection()
        Handles use infobase launch button selection.
      • handleInfobaseSelection

        protected void handleInfobaseSelection​(InfobaseReference infobase)
        Handles an infobase selection.
        Parameters:
        infobase - the selected infobase, cannot be null
      • createRuntimeInstallationSettings

        protected void createRuntimeInstallationSettings​(org.eclipse.swt.widgets.Composite parent,
                                                         String label,
                                                         int viewerSpan)
        Creates 1C:Enterprise runtime installations settings UI elements.
        Parameters:
        parent - the parent composite to create on, cannot be null
        label - the viewer label text, cannot be null
        viewerSpan - the viewer horizontal span
      • createAddRuntimeButton

        protected void createAddRuntimeButton​(org.eclipse.swt.widgets.Composite parent)
        Creates "Add new runtime" button.
        Parameters:
        parent - the parent composite to create on, cannot be null
      • createAssociateAfterUpdateButton

        protected org.eclipse.swt.widgets.Button createAssociateAfterUpdateButton​(org.eclipse.swt.widgets.Composite parent)
        Creates "Associate after update" button.
        Parameters:
        parent - the parent composite to create on, cannot be null
        Returns:
        created button, never null
      • createLoadFullConfigurationButton

        protected org.eclipse.swt.widgets.Button createLoadFullConfigurationButton​(org.eclipse.swt.widgets.Composite parent)
        Creates "Load full configuration" button.
        Parameters:
        parent - the parent composite to create on, cannot be null
        Returns:
        created button, never null
      • createUpdateBeforeLaunchButton

        protected org.eclipse.swt.widgets.Button createUpdateBeforeLaunchButton​(org.eclipse.swt.widgets.Composite parent)
        Creates "Update before launch" button.
        Parameters:
        parent - the parent composite to create on, cannot be null
        Returns:
        created button, never null
      • selectInfobaseAccessSettings

        protected void selectInfobaseAccessSettings​(InfobaseReference infobase)
        Selects infobase access settings, appropriate for the given infobase instance.
        Parameters:
        infobase - infobase instance to select appropriate access settings for, cannot be null
      • getContextProject

        protected org.eclipse.core.resources.IProject getContextProject()
        Returns the current context project. Can return null.
        Returns:
        current the context project, or null if there isn't one
      • askForInfobaseAssociation

        protected boolean askForInfobaseAssociation​(org.eclipse.core.resources.IProject project,
                                                    InfobaseReference infobase)
        Asks for infobase association of the given project with the given infobase. Returns, whether infobase was associated.
        Parameters:
        project - the project to associate, cannot be null
        infobase - the infobase to associate, cannot be null
        Returns:
        whether infobase was associated
      • checkAssociation

        protected void checkAssociation​(org.eclipse.core.resources.IProject project,
                                        InfobaseReference infobase)
        Checks current association state of the project with infobase. Default implementation does nothing.
        Parameters:
        project - the project to check, cannot be null
        infobase - the selected infobase, cannot be null
      • performApplyLaunchInfobase

        protected boolean performApplyLaunchInfobase​(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
        Performs apply launch infobase settings to launch configuration.
        Parameters:
        configuration - the launch configuration to apply, cannot be null
        Returns:
        whether the infobase was changes since last launch configuration modification
      • performApplyDebugInfobase

        protected void performApplyDebugInfobase​(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration,
                                                 boolean defaultInfobase,
                                                 InfobaseReference infobase)
        Performs apply debug infobase settings to launch configuration.
        Parameters:
        configuration - the launch configuration to apply, cannot be null
        defaultInfobase - whether need to use default project associated infobase for launch
        infobase - the infobase to use or null if infobase was deselected
      • isLaunchingInfobase

        protected boolean isLaunchingInfobase()
        Returns whether this client is launching the selecting infobase.
        Returns:
        whether this client is launching the selecting infobase
      • setDefaultInfobase

        protected void setDefaultInfobase​(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration,
                                          InfobaseReference infobase)
        Set the default infobase for the launch configuration default settings. Default implementation does nothing.
        Parameters:
        configuration - the launch configuration, cannot be null
        infobase - the infobase, cannot be null
      • setDefaultRuntimeInstallation

        protected void setDefaultRuntimeInstallation​(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration,
                                                     org.eclipse.core.resources.IProject project,
                                                     InfobaseReference infobase)
        Sets the default 1C:Enterprise runtime for the launch configuration default settings.
        Parameters:
        configuration - the launch configuration, cannot be null
        project - the project, cannot be null
        infobase - the infobase, cannot be null
      • validateProject

        protected boolean validateProject()
        Validates project selection.
        Returns:
        whether this selection is in a valid state
      • validateProject

        protected boolean validateProject​(ApplicationUsePurpose usePurpose,
                                          String label)
        Validates project selection and project configuration use purpose.
        Parameters:
        usePurpose - the use purpose to check, cannot be null
        label - the label for the use purpose UI usage, cannot be null
        Returns:
        whether this selection is in a valid state
      • validateInfobase

        protected boolean validateInfobase()
        Validates infobase selection.
        Returns:
        whether this selection is in a valid state
      • validateRuntimeInstallation

        protected boolean validateRuntimeInstallation()
        Validates 1C:Enterprise runtime installation selection.
        Returns:
        whether this selection is in a valid state
      • getSelectedInstallation

        protected IResolvableRuntimeInstallation getSelectedInstallation()
        Returns selected 1C:Enterprise resolvable installation or null if none is selected.
        Returns:
        selected 1C:Enterprise resolvable or null if none is selected
      • getSelectedInfobase

        protected InfobaseReference getSelectedInfobase()
        Returns selected infobase or null if none is selected.
        Returns:
        selected infobase or null if none is selected
      • getSelectedProject

        protected org.eclipse.core.resources.IProject getSelectedProject()
        Returns selected project or null if none is selected.
        Returns:
        selected project or null if none is selected
      • getInfobaseAccessType

        protected InfobaseAccessType getInfobaseAccessType()
        Returns infobase access type to use for 1C:Enterprise selection. Default implementation returns client launch type.
        Returns:
        the infobase access type to use for 1C:Enterprise selection, never null
      • getConfigurationProjects

        protected Collection<org.eclipse.core.resources.IProject> getConfigurationProjects()
        Returns a collection of all workspace V8 configuration projects.
        Returns:
        a collection of all workspace V8 configuration projects, never null