Class AbstractLaunchConfigurationTab

    • Constructor Detail

      • AbstractLaunchConfigurationTab

        public AbstractLaunchConfigurationTab()
        Default constructor.
        Since:
        3.13
    • Method Detail

      • initializeAttributes

        protected void initializeAttributes()
        Initialize attributes labels.
        Since:
        3.13
      • getLaunchConfigurationDialog

        protected ILaunchConfigurationDialog getLaunchConfigurationDialog()
        Returns the dialog this tab is contained in, or null if 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.
      • setControl

        protected void setControl​(Control control)
        Sets the control to be displayed in this tab.
        Parameters:
        control - the control for this tab
      • launched

        @Deprecated
        public void launched​(ILaunch launch)
        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:
        launched in interface ILaunchConfigurationTab
        Parameters:
        launch - the result of launching the current launch configuration
        See Also:
        ILaunchConfigurationTab.launched(ILaunch)
      • setErrorMessage

        protected void setErrorMessage​(String errorMessage)
        Sets this page's error message, possibly null.
        Parameters:
        errorMessage - the error message or null
      • setWarningMessage

        protected void setWarningMessage​(String warningMessage)
        Sets this page's warning message, possibly null.
        Parameters:
        warningMessage - the warning message or null
        Since:
        3.9
      • setMessage

        protected void setMessage​(String message)
        Sets this page's message, possibly null.
        Parameters:
        message - the message or null
      • getLaunchManager

        protected ILaunchManager getLaunchManager()
        Convenience method to return the launch manager.
        Returns:
        the launch manager
      • getShell

        protected Shell getShell()
        Returns the shell this tab is contained in, or null.
        Returns:
        the shell this tab is contained in, or null
      • createPushButton

        protected Button createPushButton​(Composite parent,
                                          String label,
                                          Image image)
        Creates and returns a new push button with the given label and/or image.
        Parameters:
        parent - parent control
        label - button label or null
        image - image of null
        Returns:
        a new push button
      • createRadioButton

        protected Button createRadioButton​(Composite parent,
                                           String label)
        Creates and returns a new radio button with the given label and/or image.
        Parameters:
        parent - parent control
        label - button label or null
        Returns:
        a new radio button
      • createCheckButton

        protected Button createCheckButton​(Composite parent,
                                           String label)
        Creates and returns a new check button with the given label.
        Parameters:
        parent - the parent composite
        label - the button label
        Returns:
        a new check button
        Since:
        3.0
      • canSave

        public boolean canSave()
        Description copied from interface: ILaunchConfigurationTab
        Returns whether this tab is in a state that allows the launch configuration whose values this tab is showing to be saved. This differs from isValid() in that canSave() determines if this tab prevents the current launch configuration from being saved, whereas isValid() 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:
        canSave in interface ILaunchConfigurationTab
        Returns:
        whether this tab is in a state that allows the current launch configuration to be saved
        See Also:
        ILaunchConfigurationTab.canSave()
      • isValid

        public boolean isValid​(ILaunchConfiguration launchConfig)
        Description copied from interface: ILaunchConfigurationTab
        Returns 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:
        isValid in interface ILaunchConfigurationTab
        Parameters:
        launchConfig - launch configuration which provides context for validating this tab. This value must not be null.
        Returns:
        whether this tab is in a valid state
        See Also:
        ILaunchConfigurationTab.isValid(ILaunchConfiguration)
      • createVerticalSpacer

        protected void createVerticalSpacer​(Composite comp,
                                            int colSpan)
        Creates vertical space in the parent Composite
        Parameters:
        comp - the parent to add the vertical space to
        colSpan - the number of line of vertical space to add
      • createSeparator

        protected void createSeparator​(Composite comp,
                                       int colSpan)
        Create a horizontal separator.
        Parameters:
        comp - parent widget
        colSpan - number of columns to span
        Since:
        3.0
      • getId

        public String getId()
        Returns this tab's unique identifier or null if none. By default, null is 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 to null.
        Parameters:
        attribute - attribute identifier
        configuration - the configuration on which to set the attribute
        value - the value of the attribute
        defaultValue - 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

        public void activated​(ILaunchConfigurationWorkingCopy workingCopy)
        This method was added to the ILaunchConfigurationTab interface 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's initializeFrom method. 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 activated and deactivated allow tabs to determine the appropriate course of action.

        Specified by:
        activated in interface ILaunchConfigurationTab
        Parameters:
        workingCopy - the launch configuration being edited
        Since:
        3.0
        See Also:
        ILaunchConfigurationTab.activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
      • deactivated

        public void deactivated​(ILaunchConfigurationWorkingCopy workingCopy)
        This method was added to the ILaunchConfigurationTab interface 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's performApply method. 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 activated and deactivated allow tabs to determine the appropriate course of action.

        Specified by:
        deactivated in interface ILaunchConfigurationTab
        Parameters:
        workingCopy - the launch configuration being edited
        Since:
        3.0
        See Also:
        ILaunchConfigurationTab.deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
      • scheduleUpdateJob

        protected void scheduleUpdateJob()
        Schedules the update job to run for this tab based on this tab's delay.
        Since:
        3.6
      • createUpdateJob

        protected Job 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

        public void setHelpContextId​(String id)
        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

        public String getHelpContextId()
        Returns the help context id for this tab or null.
        Returns:
        the help context for this tab or null if unknown.
        Since:
        3.7
      • getAttributesLabelsForPrototype

        protected Map<String,​String> getAttributesLabelsForPrototype()
        Get the attributes labels for prototype tab.
        Returns:
        the attributes labels for prototype tab.
        Since:
        3.13