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 "CDT/LaunchBar"

< CDT
(Things to think about)
(Overview)
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
Bug is here. https://bugs.eclipse.org/bugs/show_bug.cgi?id=437392
 
Bug is here. https://bugs.eclipse.org/bugs/show_bug.cgi?id=437392
  
The LaunchBar is a Tool Control that's inserted into the top trim bar of all workbench windows. It allows the user to select an active launch configuration, an active launch mode, and an active launch target, then use the Build and Launch buttons to built for that launch and the execute the launch.
+
Implementation is in the org.eclipse.cdt.launchbar.core and org.eclipse.cdt.launchbar.ui plug-ins.
  
The launch configurations are provided by providers. They don't have to be launch configurations directly. The providers provide launch configuration descriptors that represent the potential for launch configurations but the configs are only created when needed. This allows us to provide automated launch configuration creation without actually having to create them if they aren't going to be used.
+
Providers for CDT projects will be in the org.eclipse.cdt.launchbar.cdt.core and org.eclipse.cdt.launchbar.cdt.ui plug-ins.
  
As an example, CDT will provide descriptors for each project that builds to an executable. It will automatically appear in the launch configurations selector when the project is created. When the user clicks build or launch, it will create the launch configuration with reasonable defaults for the given active launch mode and target. This way the user never has to go the the launch configuration dialog. If the user does already have a launch configuration for that project, for example - one checked in with the project, it will be used instead. The provider will get notified of the launch config and can decide what to do with it.
+
== UI ==
  
There is a default launch configuration descriptor provided as a default if no providers are interested in a given launch configuration. This provides support for legacy launch configs so the launch bar is immediately useful without any providers.
+
Screenshot is here:
  
Launch modes become the preferred way of running tools. These are defined by plug-ins and can be provided for things like code coverage, and the various valgrind tools, etc.
+
[[File:CDTLaunchBar.png]]
  
Launch targets are the devices you launch to. One is provided automatically for the Local Machine target. It's the one that default launch configs, for example, use.
+
The LaunchBar is a Tool Control that's inserted into the top trim bar of all workbench windows. It has three selectors (fancy custom combo dropdowns), and three buttons. The three selectors are:
  
The CDT will provide CDT launch targets that allow us to determine which build configurations and which binaries are valid for the given target type. A Local CDT Machine (although likely also called Local Machine) will be provided to represent the host. CDT plug-ins can provide additional ones for the platforms they support.
+
# Active Launch Mode
 +
# Active Launch Descriptor
 +
# Active Launch Target
  
I expect Android targets to also be supported to allow launching of Android projects to those targets using the toolbar.
+
The buttons are:
  
== Things to think about ==
+
# Build for launch
 +
# Launch
 +
# Stop active build and/or launch
  
If we have no launch targets types defined other than the built-in Local, we probably shouldn't show the launch targets at all since it eats up toolbar space for no reason.
+
There is the concept of active Launch Configuration that is used by the buttons. It is determined by the combination of descriptor type and target type. The edit button (the gear) on the Launch Descriptor allows the user to edit that launch configuration using the launch configuration editor. There is also a shortcut at the bottom of the Descriptor selector to manually create a new Launch Configuration. We'll go into more detail on this in the following sections.
  
Allow enabling/disabling the tool control per perspective.
+
There is also an edit button on the target to change properties for the target, such as communication channel to get to it, etc.
 +
 
 +
== Model ==
 +
 
 +
The main requirement for the LaunchBar is to make it unnecessary for the user to have to go to the launch configurations dialogs to create and set up launches. As such there needs to be enough information available to create good default launch configurations for the different tools people will want to launch from there. We've already introduced a few concepts but here's more detail on what they are and a few more that create the entire picture.
 +
 
 +
=== Launch Object ===
 +
 
 +
A thing that can drive the launch. Out of the box, we have support for ILaunchConfigurations and IProjects as things, but a provider can be added to provide other types of things.
 +
 
 +
=== Launch Descriptor ===
 +
 
 +
This is the element shown in the middle selector. It represents a Launch Object. Descriptors have a Type that watches for the creation and removal of Launch Objects and manages the creation and removal of Descriptors for those object.
 +
 
 +
=== Launch Target ===
 +
 
 +
This is the element shown in the right selector. It represents a machine that the launch will run on. Targets have Types which manage the creation and remove of Targets. The Types interface the underlying target management system with the toolbar.
 +
 
 +
=== Launch Configuration Provider ===
 +
 
 +
This is the object that manages the creation and selection of ILaunchConfiguration used by the buttons and Descriptor edit gear. Providers are registered to a given Launch Descriptor Type and Launch Target Type. They also provide access to the type of the configuration without having to create one. Each provider supports a single launch configuration type.
 +
 
 +
=== Launch Mode ===
 +
 
 +
This is the element shown in the left selector. It is actually the platform debug ILaunchMode. The list of modes are determined from the ILaunchConfigurationType returned by the Launch Configuration Provider for the currently active Launch Descriptor and Launch Target.
 +
 
 +
=== Launch Manager ===
 +
 
 +
This is the service that manages the objects, including the current selection of active objects. Each descriptor has an active mode and active target. This is persisted in preference store. The launch manager should only be
 +
 
 +
== Extensibility ==
 +
 
 +
There are two extension points provided to allow plug-in developers to add their own content to the LaunchBar, one for core (launchBarContributions) and one for UI (launchBarUIContributions).
 +
 
 +
=== Core ===
 +
 
 +
The core extension point allows for registration of descriptor types, target types, launch object providers, and launch configuration providers.
 +
 
 +
==== Launch Object Provider ====
 +
 
 +
The launch object provider watches the system for the creation and removal of launch objects. It calls on the Launch Manager which then passes the objects on to the descriptor types in a priority order.
 +
 
 +
==== Launch Descriptor Type Provider ====
 +
 
 +
Provides a descriptor type.
 +
 
 +
==== Launch Target Type Provider ====
 +
 
 +
Provides a target type
 +
 
 +
==== Launch Configuration Provider ====
 +
 
 +
The provider is mapped to a given descriptor type and target type. It creates the Launch Configurations with default values when asked.
 +
 
 +
=== UI ===
 +
 
 +
The UI extension point provides label providers, commands, and other UI elements for the LaunchBar itself.
 +
 
 +
==== descriptor ====
 +
 
 +
Provides a label provider for a descriptor type to managed the icon and text shown for a given descriptor.
 +
 
 +
==== target ====
 +
 
 +
Provides a label provider for a target type to manage the icon and text shown for a given target. The icon can show state for the target.
 +
 
 +
Provides a hover provider which shows an element when the mouse hovers over the target (sorta like a fancy tooltip).
 +
 
 +
Provides an edit command id that's called when the gear for a target is selected.
 +
 
 +
(Note there is currently an add target command id that feeds a Add New Target entry in the target selector, but we'll probably redo that to match the Add Launch Configuration wizard.)

Latest revision as of 11:11, 17 July 2014

Overview

Bug is here. https://bugs.eclipse.org/bugs/show_bug.cgi?id=437392

Implementation is in the org.eclipse.cdt.launchbar.core and org.eclipse.cdt.launchbar.ui plug-ins.

Providers for CDT projects will be in the org.eclipse.cdt.launchbar.cdt.core and org.eclipse.cdt.launchbar.cdt.ui plug-ins.

UI

Screenshot is here:

CDTLaunchBar.png

The LaunchBar is a Tool Control that's inserted into the top trim bar of all workbench windows. It has three selectors (fancy custom combo dropdowns), and three buttons. The three selectors are:

  1. Active Launch Mode
  2. Active Launch Descriptor
  3. Active Launch Target

The buttons are:

  1. Build for launch
  2. Launch
  3. Stop active build and/or launch

There is the concept of active Launch Configuration that is used by the buttons. It is determined by the combination of descriptor type and target type. The edit button (the gear) on the Launch Descriptor allows the user to edit that launch configuration using the launch configuration editor. There is also a shortcut at the bottom of the Descriptor selector to manually create a new Launch Configuration. We'll go into more detail on this in the following sections.

There is also an edit button on the target to change properties for the target, such as communication channel to get to it, etc.

Model

The main requirement for the LaunchBar is to make it unnecessary for the user to have to go to the launch configurations dialogs to create and set up launches. As such there needs to be enough information available to create good default launch configurations for the different tools people will want to launch from there. We've already introduced a few concepts but here's more detail on what they are and a few more that create the entire picture.

Launch Object

A thing that can drive the launch. Out of the box, we have support for ILaunchConfigurations and IProjects as things, but a provider can be added to provide other types of things.

Launch Descriptor

This is the element shown in the middle selector. It represents a Launch Object. Descriptors have a Type that watches for the creation and removal of Launch Objects and manages the creation and removal of Descriptors for those object.

Launch Target

This is the element shown in the right selector. It represents a machine that the launch will run on. Targets have Types which manage the creation and remove of Targets. The Types interface the underlying target management system with the toolbar.

Launch Configuration Provider

This is the object that manages the creation and selection of ILaunchConfiguration used by the buttons and Descriptor edit gear. Providers are registered to a given Launch Descriptor Type and Launch Target Type. They also provide access to the type of the configuration without having to create one. Each provider supports a single launch configuration type.

Launch Mode

This is the element shown in the left selector. It is actually the platform debug ILaunchMode. The list of modes are determined from the ILaunchConfigurationType returned by the Launch Configuration Provider for the currently active Launch Descriptor and Launch Target.

Launch Manager

This is the service that manages the objects, including the current selection of active objects. Each descriptor has an active mode and active target. This is persisted in preference store. The launch manager should only be

Extensibility

There are two extension points provided to allow plug-in developers to add their own content to the LaunchBar, one for core (launchBarContributions) and one for UI (launchBarUIContributions).

Core

The core extension point allows for registration of descriptor types, target types, launch object providers, and launch configuration providers.

Launch Object Provider

The launch object provider watches the system for the creation and removal of launch objects. It calls on the Launch Manager which then passes the objects on to the descriptor types in a priority order.

Launch Descriptor Type Provider

Provides a descriptor type.

Launch Target Type Provider

Provides a target type

Launch Configuration Provider

The provider is mapped to a given descriptor type and target type. It creates the Launch Configurations with default values when asked.

UI

The UI extension point provides label providers, commands, and other UI elements for the LaunchBar itself.

descriptor

Provides a label provider for a descriptor type to managed the icon and text shown for a given descriptor.

target

Provides a label provider for a target type to manage the icon and text shown for a given target. The icon can show state for the target.

Provides a hover provider which shows an element when the mouse hovers over the target (sorta like a fancy tooltip).

Provides an edit command id that's called when the gear for a target is selected.

(Note there is currently an add target command id that feeds a Add New Target entry in the target selector, but we'll probably redo that to match the Add Launch Configuration wizard.)

Back to the top