Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Debug/Plan/3.6/Launch Templates"

(Update all configurations made from a template)
(Update all configurations made from a template)
Line 42: Line 42:
  
 
From time to time, attributes in a template will be modified. When the "Apply" button is pressed the user will be prompted to update all children configurations (and have the option to "do not ask again").
 
From time to time, attributes in a template will be modified. When the "Apply" button is pressed the user will be prompted to update all children configurations (and have the option to "do not ask again").
 +
 +
A button should also be available in the toolbar to apply a template to all of its children.
  
 
=== Rename a template ===
 
=== Rename a template ===

Revision as of 15:44, 14 October 2009

Launch Configuration Template Use Cases

The following use cases are intended to be used a starting point for launch configuration template design and integration into the debug platform.

Create a new template

To creating a template use the "New" drop down button in the LCD tree viewer toolbar, and select "Template".

Create a template from an existing configuration

Select the configuration in the LCD and click the "Template" toolbar button.

A configuration will automatically become a template if an existing configuration is dropped on it as a child configuration.

Assign a default template to a project

A default template can be set for each launch configration type, for each project. From the "Properties > Run/Debug Settings" for a project, the user can use check boxes to select the default configuration for a project (the viewer in the properties page will become a check box list). Similarly, we could allow a default template to be set for any workspace folder, to allow for a rich set of default configurations.

An API will be available to set a default template per launch configuration type for any given scope (using IScopeContext's - the same construct used for workspace preference settings). This allows a default template per launch configuration type to be set using a project scope.

Assign a default template to a workspace

A default template can be set for each launch configuration type in the workspace. When a launch configuration type is selected in the LCD, the tab area will be enhanced to display a check box list of all templates of that type. The check box can be used to select one template as workspace default for that type.

Create a configuration based on a specific template

Select the template in the LCD and press the "New" button. This will create a new configuration associated with the selected template, initialized with attributes from the template.

Alternatively, double-clicking on an existing template will create a configuration based on that template.

Create a configuration based on a project/workspace default template

When a new template is created in the LCD or from invoking a launch shortcut, project and workspace default template settings should be taken into account to initialize newly created configurations. The debug platform can leverage configuration resource mappings to determine what template should be used to initialize newly created configurations.

  • Select a launch configuration type node in the LCD and press the "New" button. This will create a new configuration and initialize it with default settings - ususally based on the selected resource or active editor in the workbench and usually sets a resource mapping for the configuration. The platform will locate a template based on project and workspace default settings for the configuration type and copy attributes from the first template found into the new configuration.
  • Similarly, when a launch shortcut creates a configuration and sets a resource mapping, this will trigger template initialization.

Additionally, and API will be available to create a configuration based on a set of scopes (the same as preference scopes - project, workspace, etc.), and set a default configuration for a given scope. A launch shortcut could use the new API to explicitly control what template is used (if any) when creating a new configuration. However, to allow existing shortcuts to benefit from launch templates, resource mappings will be used to trigger template initialization.

Update all configurations made from a template

From time to time, attributes in a template will be modified. When the "Apply" button is pressed the user will be prompted to update all children configurations (and have the option to "do not ask again").

A button should also be available in the toolbar to apply a template to all of its children.

Rename a template

Launch configurations keep track of which template (if any) they are based on. When a template is renamed in the LCD, all configurations made from that template may be updated to refer to the renamed template. This is much like a refactoring.

When the user renames a configuration that is a template and presses apply (or triggers a save via run/debug buttons), we could prompt the user on whether or not to update all references to the template.

Delete a template

When a template is deleted in the LCD, users could be prompted to update all configurations assocaited with the template (i.e. to no longer be assocaited with the template). The user could decide not to update associated configurations such that the template could later be replaced and all references would become satisfied.

Remove template status

A template can be made into an ordinary configuration by unchecking the "Template" box in the LCD. The user could be prompted to update all referencing configurations (similar to when a template is deleted).

Disconnect a configuration from its template

The template controls in the LCD show that a configuration is "Based on template: [X]". The user can disassociate a configuration with a its template by unchecking this check box.

Associate a configuration with an existing template

A template can be associated with an existing template, or associated with a different template by using the "Templates..." button next to the "Based on template: [X]" controls. This will present the user with a list of potential templates. The configruation will then be assocaited with the selected template. The user can use the "Restore" button to synchronize settings. The selection dialog could have an option to restore when OK is pressed.

Launch Configuration Template User Interface

Checkbox viewer on launch configuration type page

Currently, when a launch configuration type is selected in the LCD, a page of instructions is displayed on how to create and manage launch configrations. We can add a check box list to this page showing all templates of the selected type. The checked template specifies the workspace default template.

Checkbox viewer on Run/Debug settings property page

Currently, the Run/Debug settings property page is a flat list. We will make this into a check box list for projects such a that a default template can be specified at the project level.

LCD tree viewer

  • The "New" button will be enhanced to be a drop down to allow a new "Configuration" or "Template" to be created.
  • The tree viewer in the LCD will nest configurations by templates - i.e. all children of a template will be displayed as children of that template in the tree.
  • Double-clicking a template in the tree will create a new configration based on the clicked template
  • The tree will support drag & drop to allow configurations to be re-parented under a different template (or disasscoiated with any template by dragging to the top level).
  • A button will be added to the toolbar to allow the selected template to be applied/pushed to all children.

Launch Configuration Template API

API will added to the following interfaces to support launch configuration templates

ILaunchConfigurationType

  • Set a default template for a specified scope (or remove when null)
  • Get the default template for a given scope (may return null)
  • Get all templates of this type
  • Create a new working copy based on a given set of scopes

ILaunchConfigurationWorkingCopy

  • Set whether a configuration is a template
  • Set the template a configuration is based on
  • Copy attributes from a template (any configuration) into the working copy

ILaunchConfiguration

  • Return whether a configuration is a template
  • Get the template a configuration is based on (may be null)
  • Get all configurations a template is associated with

Back to the top