Class AbstractLaunchConfigurationTab
- All Implemented Interfaces:
IPrototypeAttributesLabelProvider,ILaunchConfigurationTab,ILaunchConfigurationTab2
- Direct Known Subclasses:
CommonTab,EnvironmentTab,PrototypeTab,RefreshTab,SourceLookupTab,WorkingDirectoryBlock
Clients may subclass this class.
- Since:
- 2.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivated(ILaunchConfigurationWorkingCopy workingCopy) This method was added to theILaunchConfigurationTabinterface in the 3.0 release to allow tabs to distinguish between a tab being activated and a tab group be initialized for the first time, from a selected launch configuration.booleancanSave()Returns whether this tab is in a state that allows the launch configuration whose values this tab is showing to be saved.protected ButtoncreateCheckButton(Composite parent, String label) Creates and returns a new check button with the given label.protected ButtoncreatePushButton(Composite parent, String label, Image image) Creates and returns a new push button with the given label and/or image.protected ButtoncreateRadioButton(Composite parent, String label) Creates and returns a new radio button with the given label and/or image.protected voidcreateSeparator(Composite comp, int colSpan) Create a horizontal separator.protected JobCreates and returns a job used to update the launch configuration dialog for this tab.protected voidcreateVerticalSpacer(Composite comp, int colSpan) Creates vertical space in the parentCompositevoiddeactivated(ILaunchConfigurationWorkingCopy workingCopy) This method was added to theILaunchConfigurationTabinterface in the 3.0 release to allow tabs to distinguish between a tab being deactivated and saving its attributes to a launch configuration.voiddispose()By default, do nothing.getAttributeLabel(String attribute) Get a human readable label to associate to this attribute.Get the attributes labels for prototype tab.Returns the top level control for this tab.Returns the current error message for this tab.Returns the help context id for this tab ornull.getId()Returns this tab's unique identifier ornullif none.getImage()Returns the image for this tab, ornullif noneprotected ILaunchConfigurationDialogReturns the dialog this tab is contained in, ornullif not yet set.protected ILaunchManagerConvenience method to return the launch manager.Returns the current message for this tab.protected ShellgetShell()Returns the shell this tab is contained in, ornull.protected longReturn the time delay that should be used when scheduling the update job.Returns a warning message to be displayed to the user ornullif none is present.protected voidInitialize attributes labels.protected booleanisDirty()Returns if this tab has pending changes that need to be saved.booleanisValid(ILaunchConfiguration launchConfig) Returns whether this tab is in a valid state in the context of the specified launch configuration.voidDeprecated.As of R3.0, this method is no longer called by the launch framework.protected voidSchedules the update job to run for this tab based on this tab's delay.protected voidsetAttribute(String attribute, ILaunchConfigurationWorkingCopy configuration, boolean value, boolean defaultValue) Convenience method to set a boolean attribute of on a launch configuration.protected voidsetControl(Control control) Sets the control to be displayed in this tab.protected voidsetDirty(boolean dirty) Sets the dirty state of the tab.protected voidsetErrorMessage(String errorMessage) Sets this page's error message, possiblynull.voidSets the help context id for this tab.voidSets the launch configuration dialog that hosts this tab.protected voidsetMessage(String message) Sets this page's message, possiblynull.protected voidsetWarningMessage(String warningMessage) Sets this page's warning message, possiblynull.protected voidUpdates the buttons and message in this page's launch configuration dialog.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.debug.ui.ILaunchConfigurationTab
createControl, getName, initializeFrom, OkToLeaveTab, performApply, postApply, setDefaults
-
Constructor Details
-
AbstractLaunchConfigurationTab
public AbstractLaunchConfigurationTab()Default constructor.- Since:
- 3.13
-
-
Method Details
-
initializeAttributes
protected void initializeAttributes()Initialize attributes labels.- Since:
- 3.13
-
getAttributeLabel
Description copied from interface:IPrototypeAttributesLabelProviderGet a human readable label to associate to this attribute.- Specified by:
getAttributeLabelin interfaceIPrototypeAttributesLabelProvider- Parameters:
attribute- the given attribute.- Returns:
- a human readable label of this attribute.
-
getLaunchConfigurationDialog
Returns the dialog this tab is contained in, ornullif not yet set.- Returns:
- launch configuration dialog, or
null
-
updateLaunchConfigurationDialog
protected void updateLaunchConfigurationDialog()Updates the buttons and message in this page's launch configuration dialog. -
getControl
Description copied from interface:ILaunchConfigurationTabReturns the top level control for this tab.May return
nullif the control has not been created yet.- Specified by:
getControlin interfaceILaunchConfigurationTab- Returns:
- the top level control or
null - See Also:
-
setControl
Sets the control to be displayed in this tab.- Parameters:
control- the control for this tab
-
getErrorMessage
Description copied from interface:ILaunchConfigurationTabReturns the current error message for this tab. May benullto indicate no error message.An error message should describe some error state, as opposed to a message which may simply provide instruction or information to the user.
- Specified by:
getErrorMessagein interfaceILaunchConfigurationTab- Returns:
- the error message, or
nullif none - See Also:
-
getWarningMessage
Description copied from interface:ILaunchConfigurationTab2Returns a warning message to be displayed to the user ornullif none is present.- Specified by:
getWarningMessagein interfaceILaunchConfigurationTab2- Returns:
- Returns a warning message to be displayed to the user
or
nullif none is present. - Since:
- 3.9
- See Also:
-
getMessage
Description copied from interface:ILaunchConfigurationTabReturns the current message for this tab.A message provides instruction or information to the user, as opposed to an error message which should describe some error state.
- Specified by:
getMessagein interfaceILaunchConfigurationTab- Returns:
- the message, or
nullif none - See Also:
-
launched
Deprecated.As of R3.0, this method is no longer called by the launch framework. Since tabs do not exist when launching is performed elsewhere than the launch dialog, this method cannot be relied upon for launching functionality.By default, do nothing.- Specified by:
launchedin interfaceILaunchConfigurationTab- Parameters:
launch- the result of launching the current launch configuration- See Also:
-
setLaunchConfigurationDialog
Description copied from interface:ILaunchConfigurationTabSets the launch configuration dialog that hosts this tab. This is the first method called on a launch configuration tab, and marks the beginning of this tab's lifecycle.- Specified by:
setLaunchConfigurationDialogin interfaceILaunchConfigurationTab- Parameters:
dialog- launch configuration dialog- See Also:
-
setErrorMessage
Sets this page's error message, possiblynull.- Parameters:
errorMessage- the error message ornull
-
setWarningMessage
Sets this page's warning message, possiblynull.- Parameters:
warningMessage- the warning message ornull- Since:
- 3.9
-
setMessage
Sets this page's message, possiblynull.- Parameters:
message- the message ornull
-
getLaunchManager
Convenience method to return the launch manager.- Returns:
- the launch manager
-
dispose
public void dispose()By default, do nothing.- Specified by:
disposein interfaceILaunchConfigurationTab- See Also:
-
getShell
Returns the shell this tab is contained in, ornull.- Returns:
- the shell this tab is contained in, or
null
-
createPushButton
Creates and returns a new push button with the given label and/or image.- Parameters:
parent- parent controllabel- button label ornullimage- image ofnull- Returns:
- a new push button
-
createRadioButton
Creates and returns a new radio button with the given label and/or image.- Parameters:
parent- parent controllabel- button label ornull- Returns:
- a new radio button
-
createCheckButton
Creates and returns a new check button with the given label.- Parameters:
parent- the parent compositelabel- the button label- Returns:
- a new check button
- Since:
- 3.0
-
canSave
public boolean canSave()Description copied from interface:ILaunchConfigurationTabReturns whether this tab is in a state that allows the launch configuration whose values this tab is showing to be saved. This differs fromisValid()in thatcanSave()determines if this tab prevents the current launch configuration from being saved, whereasisValid()determines if this tab prevents the current launch configuration from being launched.This information is typically used by the launch configuration dialog to decide when it is okay to save a launch configuration.
- Specified by:
canSavein interfaceILaunchConfigurationTab- Returns:
- whether this tab is in a state that allows the current launch configuration to be saved
- See Also:
-
isValid
Description copied from interface:ILaunchConfigurationTabReturns whether this tab is in a valid state in the context of the specified launch configuration.This information is typically used by the launch configuration dialog to decide when it is okay to launch.
- Specified by:
isValidin interfaceILaunchConfigurationTab- Parameters:
launchConfig- launch configuration which provides context for validating this tab. This value must not benull.- Returns:
- whether this tab is in a valid state
- See Also:
-
createVerticalSpacer
Creates vertical space in the parentComposite- Parameters:
comp- the parent to add the vertical space tocolSpan- the number of line of vertical space to add
-
createSeparator
Create a horizontal separator.- Parameters:
comp- parent widgetcolSpan- number of columns to span- Since:
- 3.0
-
getImage
Description copied from interface:ILaunchConfigurationTabReturns the image for this tab, ornullif none- Specified by:
getImagein interfaceILaunchConfigurationTab- Returns:
- the image for this tab, or
nullif none - See Also:
-
getId
Returns this tab's unique identifier ornullif none. By default,nullis returned. Subclasses should override as necessary.Tab identifiers allow contributed tabs to be ordered relative to one another.
- Returns:
- tab id or
null - Since:
- 3.3
-
setAttribute
protected void setAttribute(String attribute, ILaunchConfigurationWorkingCopy configuration, boolean value, boolean defaultValue) Convenience method to set a boolean attribute of on a launch configuration. If the value being set is the default, the attribute's value is set tonull.- Parameters:
attribute- attribute identifierconfiguration- the configuration on which to set the attributevalue- the value of the attributedefaultValue- the default value of the attribute- Since:
- 2.1
-
isDirty
protected boolean isDirty()Returns if this tab has pending changes that need to be saved. It is up to clients to set/reset and consult this attribute as required. By default, a tab is initialized to dirty for backwards compatibility.- Returns:
- whether this tab is dirty
- Since:
- 2.1
-
setDirty
protected void setDirty(boolean dirty) Sets the dirty state of the tab. Setting this flag allows clients to explicitly say whether this tab has pending changes or not. It is up to clients to set/reset and consult this attribute as required. By default, a tab is initialized to dirty for backwards compatibility.- Parameters:
dirty- what to set the dirty flag to- Since:
- 2.1
-
activated
This method was added to theILaunchConfigurationTabinterface in the 3.0 release to allow tabs to distinguish between a tab being activated and a tab group be initialized for the first time, from a selected launch configuration. To maintain backwards compatible behavior, the default implementation provided, calls this tab'sinitializeFrommethod. Tabs should override this method as required.The launch tab framework was originally designed to take care of inter tab communication by applying attributes from the active tab to the launch configuration being edited, when a tab is exited, and by initializing a tab when activated. The addition of the methods
activatedanddeactivatedallow tabs to determine the appropriate course of action.- Specified by:
activatedin interfaceILaunchConfigurationTab- Parameters:
workingCopy- the launch configuration being edited- Since:
- 3.0
- See Also:
-
deactivated
This method was added to theILaunchConfigurationTabinterface in the 3.0 release to allow tabs to distinguish between a tab being deactivated and saving its attributes to a launch configuration. To maintain backwards compatible behavior, the default implementation provided, calls this tab'sperformApplymethod. Tabs should override this method as required.The launch tab framework was originally designed to take care of inter tab communication by applying attributes from the active tab to the launch configuration being edited, when a tab is exited, and by initializing a tab when activated. The addition of the methods
activatedanddeactivatedallow tabs to determine the appropriate course of action.- Specified by:
deactivatedin interfaceILaunchConfigurationTab- Parameters:
workingCopy- the launch configuration being edited- Since:
- 3.0
- See Also:
-
scheduleUpdateJob
protected void scheduleUpdateJob()Schedules the update job to run for this tab based on this tab's delay.- Since:
- 3.6
-
createUpdateJob
Creates and returns a job used to update the launch configuration dialog for this tab. Subclasses may override.- Returns:
- job to update the launch dialog for this tab
- Since:
- 3.6
-
getUpdateJobDelay
protected long getUpdateJobDelay()Return the time delay that should be used when scheduling the update job. Subclasses may override.- Returns:
- a time delay in milliseconds before the job should run
- Since:
- 3.6
-
setHelpContextId
Sets the help context id for this tab.Not all tabs honor this setting, but if this method is called prior to
ILaunchConfigurationTab.createControl(Composite), a tab implementation may use this to set the context help associated with this tab.- Parameters:
id- help context id- Since:
- 3.7
-
getHelpContextId
Returns the help context id for this tab ornull.- Returns:
- the help context for this tab or
nullif unknown. - Since:
- 3.7
-
getAttributesLabelsForPrototype
Get the attributes labels for prototype tab.- Returns:
- the attributes labels for prototype tab.
- Since:
- 3.13
-