Class AbstractLaunchingTab
- java.lang.Object
-
- org.eclipse.debug.ui.AbstractLaunchConfigurationTab
-
- com._1c.g5.v8.dt.internal.launching.ui.launchconfigurations.AbstractRuntimeClientTab
-
- com._1c.g5.v8.dt.launching.ui.launchconfigurations.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 Summary
-
Constructor Summary
Constructors Constructor Description AbstractLaunchingTab(String runtimeTypeId, String runtimewizardId)
Creates an instance ofAbstractLaunchingTab
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
askForInfobaseAssociation(org.eclipse.core.resources.IProject project, InfobaseReference infobase)
Asks for infobase association of the given project with the given infobase.protected void
checkAssociation(org.eclipse.core.resources.IProject project, InfobaseReference infobase)
Checks current association state of the project with infobase.protected void
createAddRuntimeButton(org.eclipse.swt.widgets.Composite parent)
Creates "Add new runtime" button.protected org.eclipse.swt.widgets.Button
createAssociateAfterUpdateButton(org.eclipse.swt.widgets.Composite parent)
Creates "Associate after update" button.protected void
createInfobaseSettings(org.eclipse.swt.widgets.Composite parent)
Creates infobase settings UI elements.protected org.eclipse.swt.widgets.Button
createLoadFullConfigurationButton(org.eclipse.swt.widgets.Composite parent)
Creates "Load full configuration" button.protected void
createProjectSettings(org.eclipse.swt.widgets.Composite parent)
Create project settings UI elements.protected void
createRuntimeInstallationSettings(org.eclipse.swt.widgets.Composite parent, String label, int viewerSpan)
Creates 1C:Enterprise runtime installations settings UI elements.protected org.eclipse.swt.widgets.Button
createUpdateBeforeLaunchButton(org.eclipse.swt.widgets.Composite parent)
Creates "Update before launch" button.void
deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy workingCopy)
void
dispose()
protected Collection<org.eclipse.core.resources.IProject>
getConfigurationProjects()
Returns a collection of all workspace V8 configuration projects.protected org.eclipse.core.resources.IProject
getContextProject()
Returns the current context project.protected InfobaseAccessType
getInfobaseAccessType()
Returns infobase access type to use for 1C:Enterprise selection.protected InfobaseReference
getSelectedInfobase()
Returns selected infobase ornull
if none is selected.protected IResolvableRuntimeInstallation
getSelectedInstallation()
Returns selected 1C:Enterprise resolvable installation ornull
if none is selected.protected org.eclipse.core.resources.IProject
getSelectedProject()
Returns selected project ornull
if none is selected.protected void
handleInfobaseSelection(InfobaseReference infobase)
Handles an infobase selection.protected void
handleProjectSelection(org.eclipse.core.resources.IProject project)
Handles a project selection.protected void
handleUseDefaultInfobaseLaunchSelection()
Handles use default infobase launch button selection.protected void
handleUseInfobaseLaunchSelection()
Handles use infobase launch button selection.void
infobaseAccessSettingsChanged(InfobaseReference infobase, IInfobaseAccessSettings settings, boolean authenticationFailed)
Notifies that infobase access settings was stored for the given infobase.void
initializeFrom(org.eclipse.debug.core.ILaunchConfiguration configuration)
protected Optional<InfobaseReference>
initializeInfobaseSettings(org.eclipse.debug.core.ILaunchConfiguration configuration, org.eclipse.core.resources.IProject project)
Initialize launch infobase UI settings based on the provided launch configuration.void
installationAccessSettingsChanged(org.eclipse.core.resources.IProject project, InfobaseReference infobase, IResolvableRuntimeInstallation installation)
Notifies that installation access settings was stored for the given infobase.protected boolean
isLaunchingInfobase()
Returns whether this client is launching the selecting infobase.boolean
isValid(org.eclipse.debug.core.ILaunchConfiguration launchConfig)
void
modifyText(org.eclipse.swt.events.ModifyEvent e)
protected void
performApplyDebugInfobase(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration, boolean defaultInfobase, InfobaseReference infobase)
Performs apply debug infobase settings to launch configuration.protected boolean
performApplyLaunchInfobase(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
Performs apply launch infobase settings to launch configuration.protected void
selectInfobaseAccessSettings(InfobaseReference infobase)
Selects infobase access settings, appropriate for the given infobase instance.void
selectionChanged(SelectionChangedEvent event)
protected void
setDefaultInfobase(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration, InfobaseReference infobase)
Set the default infobase for the launch configuration default settings.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.void
setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
protected boolean
validateInfobase()
Validates infobase selection.protected boolean
validateProject()
Validates project selection.protected boolean
validateProject(ApplicationUsePurpose usePurpose, String label)
Validates project selection and project configuration use purpose.protected boolean
validateRuntimeInstallation()
Validates 1C:Enterprise runtime installation selection.void
widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
void
widgetSelected(org.eclipse.swt.events.SelectionEvent e)
-
Methods inherited from class com._1c.g5.v8.dt.internal.launching.ui.launchconfigurations.AbstractRuntimeClientTab
canClientOpenUri, canRunRuntimeClient, doInitializeFrom, doRuntimeClientAutoSelected, doRuntimeClientChanged, getClientTypeId, getClientTypeId, infobaseChanged, isAutoSelect, isAutoSelect, projectChanged, runtimeClientAutoSelected, runtimeClientChanged, setVisible
-
Methods inherited from class org.eclipse.debug.ui.AbstractLaunchConfigurationTab
activated, canSave, createCheckButton, createPushButton, createRadioButton, createSeparator, createUpdateJob, createVerticalSpacer, getAttributeLabel, getAttributesLabelsForPrototype, getControl, getErrorMessage, getHelpContextId, getId, getImage, getLaunchConfigurationDialog, getLaunchManager, getMessage, getShell, getUpdateJobDelay, getWarningMessage, initializeAttributes, isDirty, launched, scheduleUpdateJob, setAttribute, setControl, setDirty, setErrorMessage, setHelpContextId, setLaunchConfigurationDialog, setMessage, setWarningMessage, updateLaunchConfigurationDialog
-
-
-
-
Field Detail
-
configurationProvider
@Inject protected IConfigurationProvider configurationProvider
-
runtimeVersionSupport
@Inject protected IRuntimeVersionSupport runtimeVersionSupport
-
v8projectManager
@Inject protected IV8ProjectManager v8projectManager
-
resolvableRuntimeInstallationManager
@Inject protected IResolvableRuntimeInstallationManager resolvableRuntimeInstallationManager
-
infobaseAccessManager
@Inject protected IInfobaseAccessManager infobaseAccessManager
-
infobaseAssociationContextProvider
@Inject protected IInfobaseAssociationContextProvider infobaseAssociationContextProvider
-
infobaseAssociationManager
@Inject protected IInfobaseAssociationManager infobaseAssociationManager
-
uiFactory
@Inject protected PlatformServicesUiFactory uiFactory
-
projectViewer
protected ComboViewer projectViewer
-
useDefaultAssociationInfobaseLaunch
protected org.eclipse.swt.widgets.Button useDefaultAssociationInfobaseLaunch
-
useSelectedInfobaseLaunch
protected org.eclipse.swt.widgets.Button useSelectedInfobaseLaunch
-
infobaseViewer
protected ComboViewer infobaseViewer
-
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
-
infobaseViewerListener
protected ISelectionChangedListener infobaseViewerListener
-
projectViewerListener
protected ISelectionChangedListener projectViewerListener
-
oldInfobaseSelection
protected InfobaseReference oldInfobaseSelection
-
runtimeTypeId
protected String runtimeTypeId
-
runtimewizardId
protected String runtimewizardId
-
-
Constructor Detail
-
AbstractLaunchingTab
public AbstractLaunchingTab(String runtimeTypeId, String runtimewizardId)
Creates an instance ofAbstractLaunchingTab
.- Parameters:
runtimeTypeId
- the 1C:Enterprise installation type id, cannot benull
runtimewizardId
- the 1C:Enterprise installation wizard id, cannot benull
-
-
Method Detail
-
setDefaults
public void setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
- Specified by:
setDefaults
in interfaceorg.eclipse.debug.ui.ILaunchConfigurationTab
-
initializeFrom
public void initializeFrom(org.eclipse.debug.core.ILaunchConfiguration configuration)
- Specified by:
initializeFrom
in interfaceorg.eclipse.debug.ui.ILaunchConfigurationTab
- Overrides:
initializeFrom
in classcom._1c.g5.v8.dt.internal.launching.ui.launchconfigurations.AbstractRuntimeClientTab
-
deactivated
public void deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy workingCopy)
- Specified by:
deactivated
in interfaceorg.eclipse.debug.ui.ILaunchConfigurationTab
- Overrides:
deactivated
in classorg.eclipse.debug.ui.AbstractLaunchConfigurationTab
-
isValid
public boolean isValid(org.eclipse.debug.core.ILaunchConfiguration launchConfig)
- Specified by:
isValid
in interfaceorg.eclipse.debug.ui.ILaunchConfigurationTab
- Overrides:
isValid
in classorg.eclipse.debug.ui.AbstractLaunchConfigurationTab
-
modifyText
public void modifyText(org.eclipse.swt.events.ModifyEvent e)
- Specified by:
modifyText
in interfaceorg.eclipse.swt.events.ModifyListener
-
widgetSelected
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
- Specified by:
widgetSelected
in interfaceorg.eclipse.swt.events.SelectionListener
-
widgetDefaultSelected
public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
- Specified by:
widgetDefaultSelected
in interfaceorg.eclipse.swt.events.SelectionListener
-
selectionChanged
public void selectionChanged(SelectionChangedEvent event)
- Specified by:
selectionChanged
in interfaceISelectionChangedListener
-
infobaseAccessSettingsChanged
public void infobaseAccessSettingsChanged(InfobaseReference infobase, IInfobaseAccessSettings settings, boolean authenticationFailed)
Description copied from interface:IInfobaseAccessSettingsChangeListener
Notifies that infobase access settings was stored for the given infobase.- Specified by:
infobaseAccessSettingsChanged
in interfaceIInfobaseAccessSettingsChangeListener
- Parameters:
infobase
- the infobase that access settings was canged, cannot benull
settings
- the changed infobase access settings, cannot benull
authenticationFailed
-true
if settings were changed after failed authentication,false
if the settings were changed before authentication
-
installationAccessSettingsChanged
public void installationAccessSettingsChanged(org.eclipse.core.resources.IProject project, InfobaseReference infobase, IResolvableRuntimeInstallation installation)
Description copied from interface:IInfobaseAccessSettingsChangeListener
Notifies that installation access settings was stored for the given infobase.- Specified by:
installationAccessSettingsChanged
in interfaceIInfobaseAccessSettingsChangeListener
- Parameters:
project
- the project that installation settings was canged, cannot benull
infobase
- the infobase that installation settings was canged, cannot benull
installation
- the new installation settings, cannot benull
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceorg.eclipse.debug.ui.ILaunchConfigurationTab
- Overrides:
dispose
in classorg.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 benull
project
- the project to use, cannot benull
- 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 benull
-
handleProjectSelection
protected void handleProjectSelection(org.eclipse.core.resources.IProject project)
Handles a project selection.- Parameters:
project
- the selected project, cannot benull
-
createInfobaseSettings
protected void createInfobaseSettings(org.eclipse.swt.widgets.Composite parent)
Creates infobase settings UI elements.- Parameters:
parent
- the parent composite to create on, cannot benull
-
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 benull
-
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 benull
label
- the viewer label text, cannot benull
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 benull
-
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 benull
- 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 benull
- 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 benull
- 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 benull
-
getContextProject
protected org.eclipse.core.resources.IProject getContextProject()
Returns the current context project. Can returnnull
.- 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 benull
infobase
- the infobase to associate, cannot benull
- 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 benull
infobase
- the selected infobase, cannot benull
-
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 benull
- 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 benull
defaultInfobase
- whether need to use default project associated infobase for launchinfobase
- the infobase to use ornull
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 benull
infobase
- the infobase, cannot benull
-
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 benull
project
- the project, cannot benull
infobase
- the infobase, cannot benull
-
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 benull
label
- the label for the use purpose UI usage, cannot benull
- 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 ornull
if none is selected.- Returns:
- selected 1C:Enterprise resolvable or
null
if none is selected
-
getSelectedInfobase
protected InfobaseReference getSelectedInfobase()
Returns selected infobase ornull
if none is selected.- Returns:
- selected infobase or
null
if none is selected
-
getSelectedProject
protected org.eclipse.core.resources.IProject getSelectedProject()
Returns selected project ornull
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
-
-