Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Link with editor for semantic elements
Link with editor for semantic elements [message #1498319] Thu, 04 December 2014 10:16 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
Hi,

In the model explorer, when I enable 'Link to elements'. Clicking on
whitespace in a diagram will select the diagram in the model explorer.
When I select an element, I imagined that the semantic element should be
selected in the model explorer, but it doesn't happen. Is this expected?
Re: Link with editor for semantic elements [message #1498371 is a reply to message #1498319] Thu, 04 December 2014 11:02 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Felix

Le 04/12/2014 11:16, Felix Dorner a écrit :
> Hi,
>
> In the model explorer, when I enable 'Link to elements'. Clicking on
> whitespace in a diagram will select the diagram in the model explorer.
> When I select an element, I imagined that the semantic element should be
> selected in the model explorer, but it doesn't happen. Is this expected?

This is the expected and current behavior.

On one hand, like your previous post on panning, the Outline can be used
to do that: you can switch between the outline (filtered tree) page and
the overview page. From the tree page, the semantic elements are
displayed following the diagram structure, you can show/hide them and if
you select an element, it will be selected and revealed in the diagra
editor.

On the other hand, this could be an interesting enhancement to improve
the link with editor feature. Could you create an enhancement on the
bugzilla ?

But note that it is note the base contract of "Link with editor feature"
and when the user change the selection in its active editor, the
selection change is reported to the outline, not to the active views.

The Link with editor support works with the ILinkHelper interface:

/*******************************************************************************
* Copyright (c) 2003, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation

*******************************************************************************/
[...]
/**
* <p>
* Provides information to the Common Navigator on how to link
selections with
* active editors and vice versa.
* </p>
* <p>
* The Common Navigator allows clients to plug-in their own custom
logic for
* linking selections from the Viewer to active editors. This interface
is used
* by the <b>org.eclipse.ui.navigator.linkHelper </b> extension
* point to gather information and trigger editor activations.
* </p>
*
* @since 3.2
*/
public interface ILinkHelper {
/**
* <p>
* Determine the correct structured selection for the Common Navigator
given
* anInput.
* </p>
*
* @param anInput
* An Editor input
* @return A selection to be set against the {@link CommonViewer}
*/
IStructuredSelection findSelection(IEditorInput anInput);

/**
* <p>
* Activate the correct editor for aSelection.
* </p>
*
* @param aPage
* A WorkbenchPage to use for editor location and activation
* @param aSelection
* The current selection from the {@link CommonViewer}
*/
void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection);
}


The findSelection method seems to be called only when the user activate
an editor by clicking on the corresponding tab and the activateEditor
method when the user clic on an element in a CommonViewer with active
Link with editor support.

If the choice is made to synchronize the selection, the
SessionLinkHelper should be improved to be sure to avoid cycles and our
content provider/linkhelper/other component could react to the
DialecEditor selection changes to change the selection when the Link
with editor support is enabled.

Whith the current behavior, when the user clicks on a Representation
editor and activates it, the selection in the model explorer (with
active Link with editor) is put on the DRepresentation item (usefull
when you have several editors/representations on the same semantic
element). So if we add this kind of synchronization, we have to pay
attention to this case and for the selection of one (many?) smeantic
element select them in the model explorer (and avoid selection cycles)

Regards

--
Maxime - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Panning
Next Topic:Begin operation not available within table representation
Goto Forum:
  


Current Time: Fri Mar 29 00:54:00 GMT 2024

Powered by FUDForum. Page generated in 0.02667 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top