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

DSDP/DD/MultiContext UnlinkViewContextProposal

< DSDP‎ | DD
Revision as of 19:09, 7 September 2007 by Pawel.piech.windriver.com (Talk | contribs)

Overview

This is a proposal to change the workflow of selecting the context for data displayed in standard debug views. This includes: Variables, Registers, Expressions, Memory, and possibly the Console views. This proposal builds on the previous efforts to implement "pin and clone" functionality in these views.

Goals

  • To make it possible to switch the active context of a debug view without exiting the view.
  • To make it possible to switch the active context of a debug view and without having to have the Launch view visible.
  • To make it possible to have multiple instances of debug views open and showing data from different contexts side-by-side.
  • To avoid violating any established UI paradigms with respect to views' interaction.

New UI Components and Workflow changes

Debug context selection dialog

A modal new selection dialog would allow user to choose the input context. When the debug context selection dialog is opened it shows a tree viewer where the top nodes are the participating debug context providers. Platform will provide the Launch Manager as the standard debug context provider, but others, such as Target Manager could also be shown. User can select the desired context in the dialog and press OK.

The debug context selection dialog should have a dedicated key binding and a tool-bar button (or view menu item).

Link button

The standard debug views should all have a link toggle button on their toolbars. If the link button is down (default), the view context follows the active debug context as is does currently. If the link button is up, the input context into the view does not change unless it is explicitly changed by the user with the input selection dialog.

View content description

With the debug views able to select their own input context and with the Launch view possibly hidden or absent, it may be difficult to determine what actually is the current context of a given debug view. To address this problem, the content description of the view should be activated whenever a debug view is showing contents from a context that is different from the currently selected window context.

The content description of a view is currently rather limited in that it is only capable of showing text. To make it more useful for this feature, it should be extended to provide an icon as well.

Multiple view instances

Standard debug views should be configured to allow multiple instances of views to be opened. A toolbar button (or view menu item) should be added to easily open a new instance of the view. The memory view already supports this feature.

APIs

Debug context selection dialog

Debug context mechanism allows for multiple context providers to be present, which are registered with the IDebugContextService.addContextProvider() call. However the debug selection dialog should be able to operate even if the debug view and other debug context providers are not open. Therefore a new interface is needed:

public interface IDebugContextRoot {
    Object getRootElement();
}

To allow the lazy loading of IDebugContextRoot implementations, an extension point should also be provided to register context roots. When the context selection dialog is first opened the context root would be instantiated.

The root element returned by getRootElement() can then be used in the selection dialog to populate the contents of the dialog using the flexible hierarchy APIs (IElementContentProvider).

Alternative Design

One problem with the above design is that IElementContentProvider implementations for the elements returned in a hierarchy under the element returned by getRootElement, would need to support the IPresentationContext from the selection dialog. With the current implementation of the standard debug model content providers and model proxies, this could be a big problem.

To address this, the Debug context selection dialog could be split into two parts:

  1. A drop-down selection control allowing user to choose the IDebugContextRoot
  2. A tree viewer with the elements' hierarchy.

Another method would be added to the IDebugContextRoot: IPresentationContext getPresentationContext().

This design also has the added advantage in that the extension points providing IDebugContextRoot would not have to be invoked until the user chose the given root in the drop down.

IDebugContextService extensions

The standard debug views are listeners to the events coming from the context service for the given window which they are in. Besides the input into the view, the active context returned by context service is used by actions which are contributed to the debug views. If the standard debug views are to be able to change their active context, they need a way of notifying the context service of the active context in the view so that the view actions are in sync. IDebugContextService has the addDebugContextProvider() method which should allow the view to specify its own provider when it is not listening to the active provider. Also, listeners (actions) can register themselves as listeners to events using addDebugContextListener(IDebugContextListener listener, String partId). However, listeners registered this way will not receive any events if there is no provider registered for that ID. I propose the following change:

  • Listeners registered using addDebugContextListener(IDebugContextListener listener, String partId) should receive active window context events if there is no provider registered with the given ID.

Another problem with the using current mechanism is that if the view is NOT unlinked from the window context, but the user still selects a new input context to the view, the view and its actions should be immediately updated when the window context changes. If the view were to register itself as a debug context provider for this case, it would not receive the event when the window context changed. To address this I propose the extension:

  • New IDebugContextService.setActiveContext(String partId, ISelection context) method. This method would temporarily change the active context for the given part (generating a corresponding event to listeners) but the context would still change as soon as the active window provider issued a new event.

Back to the top