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/Launch Configuration Templates"

(Purpose)
(API [WIP])
 
(29 intermediate revisions by 2 users not shown)
Line 15: Line 15:
 
==UI==
 
==UI==
  
A new tab named Template will be available for configurations. This tab allows to select an existing template for an existing configuration.
+
'''Template''' doesn't seem to be the appropriate term for this mechanism. '''Prototype''' is the term used in the following sketches. The community should agree on a definitive term.
The API will let developers decide if templates will be able to be used by their own configurations.
+
  
[[File:Configuration_New_Template_Tab.png]]
 
  
 +
A new icon will be available in the action bar on the left side of the window. It will allow to create a new prototype in the selected category.
  
A new icon will be available in the action bar on the left side of the window. It will allow to create a new template in the selected category.
+
[[File:Run_Configurations_New_Prototype_Icon_v5.png|900px]]
 
+
[[File:Run_Configurations_New_Template_Icon.png]]
+
  
  
Line 29: Line 26:
 
This menu will be updated with new entries:
 
This menu will be updated with new entries:
 
*New configuration: replace the existing ''New'' entry.
 
*New configuration: replace the existing ''New'' entry.
*New template: allows to create a new template in the containing category.
+
*New prototype: allows to create a new prototype in the containing category.
*Reset with template values: reset the fields of the selected configuration with the values from the template. This item will be grayed if no template has been set for the selected configuration.
+
*Apply prototype: allows to apply a prototype on a configuration. It opens a new window and ask to select a prototype to apply. Note that users can also select multiple configurations of the same type. The prototype selected will be applied to the selected configurations.
  
[[File:Configuration_Item_Menu_Before_After.png]]
+
[[File:Configuration_Item_Menu_Before_After_v5.png|650px]]
  
 +
Once a prototype is applied on a configuration, new entries are available in the right-click menu:
 +
*Unapply prototype: allows to unapply a prototype on a configuration.
 +
*Reset with prototype values: reset the fields of the selected configuration with the values from the prototype. This item will be grayed if no prototype has been set for the selected configuration.
 +
 +
When a configuration is associate with a prototype, then it is move under this prototype in left tree.
 +
 +
[[File:Configuration_Item_Menu_Before_After_2_v5.png|380px]]
  
 
When a category is selected in the left panel, a right-click opens a menu.
 
When a category is selected in the left panel, a right-click opens a menu.
 
This menu will be updated with new entries:
 
This menu will be updated with new entries:
 
*New configuration: replace the existing ''New'' entry.
 
*New configuration: replace the existing ''New'' entry.
*New template: allows to create a new template in the selected category.
+
*New prototype: allows to create a new prototype in the selected category.
  
[[File:Configuration_Category_Menu_Before_After.png]]
+
[[File:Configuration_Category_Menu_Before_After_v4.png|650px]]
  
  
The UI for a new template is the following. All attributes of the configuration type will be automatically listed in a table.
+
The UI for a new prototype will be the same than the configurations for which the prototype is defined.
The columns of the table are:
+
*Attribute: the id of the field of the configuration type.
+
*Type: the type of the field (can be one among boolean, int, String, List<String>, Set<String>, Map<String, String>).
+
*Value Type: for each attribute, the user will be able to define a custom value, set an empty value, or exclude the value from the template.
+
**Custom: set a custom value in the ''Value'' column. This value will be applied to the associated field when a user will apply a template to its configuration.
+
**Empty: set an empty value (no value to set in the ''Value'' column). It means that an empty value will be applied to the associated field when a user will apply a template to its configuration.
+
**Removed: the attribute won't be taking into account by the template.
+
*Value: allows to set a value for the attribute (only used when the ''Value Type'' column is set to ''Custom'').
+
  
[[File:New_Template.png]]
+
The user sets all attributes he wants, like he did for a configuration.
  
 +
The ''Run'' button is disabled because the user can't launch a prototype, only configurations.
  
When a template is selected in the left panel, a right-click opens a menu.
+
[[File:New_Prototype_Main_Tab_v5.png|798px]]
 +
 
 +
A new tab will be added at the end of the tabs list.
 +
 
 +
This tab lists the attributes of the launch configuration. The creator of the prototype have to set the ''visibility'' state of each attribute.
 +
 
 +
The ''visibility'' state means that the attribute will be shared with the configurations based on this prototype or not.
 +
 
 +
For a new prototype, the default value of will be set to ''yes''(checked state) for all attributes.
 +
 
 +
Note that the Attribute column contains readable IDs for each attribute, not technical IDs. It means that the prototype developer will have to implement a label provider to properly display attributes to the end user.
 +
 
 +
[[File:New_Prototype_Prototype_Tab_v5.png|798px]]
 +
 
 +
When a prototype is selected in the left panel, a right-click opens a menu.
 
This new menu will be created with new entries:
 
This new menu will be created with new entries:
 
*New configuration: replace the existing ''New'' entry.
 
*New configuration: replace the existing ''New'' entry.
*New template: allows to create a new template in the selected category.
+
*New prototype: allows to create a new prototype in the selected category.
*Duplicate: duplicate the selected template.
+
*Duplicate: duplicate the selected prototype.
*Delete: delete the selected template.
+
*Delete: delete the selected prototype.
*Apply template to all configurations: apply the values of the selected template to all existing configuration of the containing category. This item will be grayed if no applicable configuration exists for the selected template.
+
 
 +
[[File:Template_Item_Menu_Before_After_v4.png|330px]]
 +
 
 +
 
 +
A new tab named Prototype will be available for configurations. This tab allows to select an existing prototype for an existing configuration.
 +
 
 +
When a prototype is selected, then the creator of the configuration can see which attributes are shared from the prototype or not.
 +
 
 +
An highlighted attribute means its value is different than its prototype. The user has modified the value in the launch configuration.
 +
 
 +
[[File:Configuration_New_Prototype_Tab_v5.png|797px]]
 +
 
 +
=== Guidelines ===
 +
 
 +
In a future version, when a configuration is associated to a prototype, then the UI could indicate which attributes comes from the prototype and which attributes have been modified by the user.
 +
 
 +
It could be done by a specific color, but it also could be done with italic fields or any another graphical difference.
 +
 
 +
For the following example, the specific color has been chosen, but it is only for the example.
 +
 
 +
[[File:Configuration_With_Prototype_v5.png|797px]]
 +
 
 +
==API [WIP]==
  
[[File:Template_Item_Menu_Before_After.png]]
+
API will added to the following interfaces to support launch configuration templates ([https://wiki.eclipse.org/Debug/Plan/3.6/Launch_Templates Some API comes from here])
  
==API==
+
===ILaunchConfigurationType===
 +
*Get all prototypes of this type
 +
*Create a new working copy of a prototype
 +
*Check if the given type supports prototypes
 +
===ILaunchConfigurationWorkingCopy===
 +
*Set whether a configuration is a prototype
 +
*Set the prototype a configuration is based on (backpointer)
 +
*Copy attributes from a prototype into the working copy
 +
===ILaunchConfiguration===
 +
*Return whether a configuration is a prototype
 +
*Get the prototype a configuration is based on (backpointer, may be null)
 +
*Get all configurations a prototype is associated with
 +
*Return whether an attribute of the configuration has been modified (the value is different than its prototype)
 +
*Set the ''visibility'' of a prototype's attribute (the attribute's value will be applied or not in associated launch configurations)
 +
===PrototypeTab===
 +
*A new tab to see which attributes of a prototype are shared (''visibility'') with associated launch configurations or not.
 +
===IPrototypeAttributesLabelProvider===
 +
*Return a readable label for an attribute of a prototype.
 +
===launchConfigurationTypes.exsd===
 +
*Add new optional parameter ''allowPrototypes'' to allow prototypes for a specific type of launch configurations. Default value is set to ''false''.
 +
===Misc===
 +
*Default color to associate to widgets linked with attributes with values from the template

Latest revision as of 12:27, 23 March 2017

Purpose

In the context of the FEEP, a development effort has been proposed for a launch configuration template mechanism.

Currently there is no share parameters between launch configurations or to change several parameters at once. The idea is to let the user define Launch Configuration Templates that behave like cookie cutters. A configuration can be based on a template, which seeds attributes in the configuration with the settings specified in the template. Once a configuration has been created, the user can override any initial settings from the template. The user can also modify the template and push changes out to the configurations based on it. A configuration maintains a backpointer to its template, but is a complete standalone configuration than can be launched, exported, shared, etc.

Initial work and analysis has already been documented on the wiki and in bug 41353.

The goal of this page is to share propositions with the community about the launch configuration template mechanism.

Proposition

Based on the already existing analysis on the wiki and in the bug 41353, the proposition is the following:

UI

Template doesn't seem to be the appropriate term for this mechanism. Prototype is the term used in the following sketches. The community should agree on a definitive term.


A new icon will be available in the action bar on the left side of the window. It will allow to create a new prototype in the selected category.

Run Configurations New Prototype Icon v5.png


When a configuration is selected in the left panel, a right-click opens a menu. This menu will be updated with new entries:

  • New configuration: replace the existing New entry.
  • New prototype: allows to create a new prototype in the containing category.
  • Apply prototype: allows to apply a prototype on a configuration. It opens a new window and ask to select a prototype to apply. Note that users can also select multiple configurations of the same type. The prototype selected will be applied to the selected configurations.

Configuration Item Menu Before After v5.png

Once a prototype is applied on a configuration, new entries are available in the right-click menu:

  • Unapply prototype: allows to unapply a prototype on a configuration.
  • Reset with prototype values: reset the fields of the selected configuration with the values from the prototype. This item will be grayed if no prototype has been set for the selected configuration.

When a configuration is associate with a prototype, then it is move under this prototype in left tree.

Configuration Item Menu Before After 2 v5.png

When a category is selected in the left panel, a right-click opens a menu. This menu will be updated with new entries:

  • New configuration: replace the existing New entry.
  • New prototype: allows to create a new prototype in the selected category.

Configuration Category Menu Before After v4.png


The UI for a new prototype will be the same than the configurations for which the prototype is defined.

The user sets all attributes he wants, like he did for a configuration.

The Run button is disabled because the user can't launch a prototype, only configurations.

New Prototype Main Tab v5.png

A new tab will be added at the end of the tabs list.

This tab lists the attributes of the launch configuration. The creator of the prototype have to set the visibility state of each attribute.

The visibility state means that the attribute will be shared with the configurations based on this prototype or not.

For a new prototype, the default value of will be set to yes(checked state) for all attributes.

Note that the Attribute column contains readable IDs for each attribute, not technical IDs. It means that the prototype developer will have to implement a label provider to properly display attributes to the end user.

New Prototype Prototype Tab v5.png

When a prototype is selected in the left panel, a right-click opens a menu. This new menu will be created with new entries:

  • New configuration: replace the existing New entry.
  • New prototype: allows to create a new prototype in the selected category.
  • Duplicate: duplicate the selected prototype.
  • Delete: delete the selected prototype.

Template Item Menu Before After v4.png


A new tab named Prototype will be available for configurations. This tab allows to select an existing prototype for an existing configuration.

When a prototype is selected, then the creator of the configuration can see which attributes are shared from the prototype or not.

An highlighted attribute means its value is different than its prototype. The user has modified the value in the launch configuration.

Configuration New Prototype Tab v5.png

Guidelines

In a future version, when a configuration is associated to a prototype, then the UI could indicate which attributes comes from the prototype and which attributes have been modified by the user.

It could be done by a specific color, but it also could be done with italic fields or any another graphical difference.

For the following example, the specific color has been chosen, but it is only for the example.

Configuration With Prototype v5.png

API [WIP]

API will added to the following interfaces to support launch configuration templates (Some API comes from here)

ILaunchConfigurationType

  • Get all prototypes of this type
  • Create a new working copy of a prototype
  • Check if the given type supports prototypes

ILaunchConfigurationWorkingCopy

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

ILaunchConfiguration

  • Return whether a configuration is a prototype
  • Get the prototype a configuration is based on (backpointer, may be null)
  • Get all configurations a prototype is associated with
  • Return whether an attribute of the configuration has been modified (the value is different than its prototype)
  • Set the visibility of a prototype's attribute (the attribute's value will be applied or not in associated launch configurations)

PrototypeTab

  • A new tab to see which attributes of a prototype are shared (visibility) with associated launch configurations or not.

IPrototypeAttributesLabelProvider

  • Return a readable label for an attribute of a prototype.

launchConfigurationTypes.exsd

  • Add new optional parameter allowPrototypes to allow prototypes for a specific type of launch configurations. Default value is set to false.

Misc

  • Default color to associate to widgets linked with attributes with values from the template

Back to the top