Class WorkingDirectoryBlock

    • Constructor Detail

      • WorkingDirectoryBlock

        protected WorkingDirectoryBlock​(String workingDirectoryAttribteName)
        Creates a new WorkingDirectoryBlock for setting a working directory.
        Parameters:
        workingDirectoryAttribteName - the name of the launch configuration attribute to set the working directory's location, cannot be null
      • WorkingDirectoryBlock

        protected WorkingDirectoryBlock​(String workingDirectoryAttribteName,
                                        String helpContextId)
        Creates a new WorkingDirectoryBlock for setting a working directory.
        Parameters:
        workingDirectoryAttribteName - the name of the launch configuration attribute to set the working directory's location, cannot be null
        helpContextId - the help context id to use to hook onto the help system
    • Method Detail

      • createControl

        public final void createControl​(Composite parent)
        Description copied from interface: ILaunchConfigurationTab
        Creates the top level control for this launch configuration tab under the given parent composite. This method is called once on tab creation, after setLaunchConfigurationDialog is called.

        Implementors are responsible for ensuring that the created control can be accessed via getControl

        Parameters:
        parent - the parent composite
      • getContainer

        protected IContainer getContainer()
        Returns the selected workspace container or null
        Returns:
        the selected workspace container or null
      • setDefaultWorkingDir

        protected void setDefaultWorkingDir()
        Sets the default working directory.
      • getProject

        protected abstract IProject getProject​(ILaunchConfiguration configuration)
                                        throws CoreException
        Returns the project associated with the specified launch configuration or null if none.
        Parameters:
        configuration - the launch configuration that has been set to this working directory block
        Returns:
        the project specified by the launch configuration, or null if nothing has been set
        Throws:
        CoreException - if an error occurred while retrieving the project from the launch configuration
      • initializeFrom

        public void initializeFrom​(ILaunchConfiguration configuration)
        Description copied from interface: ILaunchConfigurationTab
        Initializes this tab's controls with values from the given launch configuration. This method is called when a configuration is selected to view or edit, after this tab's control has been created.
        Parameters:
        configuration - launch configuration
      • getName

        public String getName()
        Description copied from interface: ILaunchConfigurationTab
        Returns the name of this tab.
        Returns:
        the name of this tab
      • log

        protected void log​(CoreException e)
        Logs exceptions that have been caught by this working directory block. Subclasses should reimplement if they wish to monitor such exceptions. Default implementation does nothing.
        Parameters:
        e - the exception to log
      • getWorkingDirectoryText

        protected final String getWorkingDirectoryText()
        Retrieves the path from the text box that has been selected.
        Returns:
        the working directory the user wishes to use
      • setDefaultWorkingDirectoryText

        protected final void setDefaultWorkingDirectoryText​(String dir)
        Sets the text of the default working directory.
        Parameters:
        dir - the directory to set the widget to
      • setOtherWorkingDirectoryText

        protected final void setOtherWorkingDirectoryText​(String dir)
        Sets the directory of the other working directory to be used.
        Parameters:
        dir - the directory to set the widget to
      • setLaunchConfiguration

        protected void setLaunchConfiguration​(ILaunchConfiguration config)
        Sets the launch configuration to be used by this working directory block.
        Parameters:
        config - set the backing launch configuration for this block
      • getLaunchConfiguration

        protected ILaunchConfiguration getLaunchConfiguration()
        Returns the launch configuration that this working directory block is using.
        Returns:
        this working directory block's launch configuration
      • setEnabled

        public final void setEnabled​(boolean enabled)
        Allows this entire block to be enabled/disabled
        Parameters:
        enabled - whether to enable it or not