Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 421392 - [Model Explorer] Link with Editor does not work properly
Summary: [Model Explorer] Link with Editor does not work properly
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Views (show other bugs)
Version: 0.10.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Camille Letavernier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 405572 419591 428537 (view as bug list)
Depends on:
Blocks: 420748
  Show dependency tree
 
Reported: 2013-11-09 09:24 EST by Toni Siljamäki CLA
Modified: 2014-02-19 11:26 EST (History)
7 users (show)

See Also:


Attachments
Proposed patch to open direct editing on double click in Model Explorer (8.66 KB, patch)
2013-11-15 11:17 EST, Andreas Muelder CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toni Siljamäki CLA 2013-11-09 09:24:48 EST
Link with Editor in Model Explorer does not work properly.

When having it enabled and selecting an element in a diagram, this element
does not get selected/highlighted in Model Explorer.

When selecting e.g an attribute in the diagram the class get expanded and
the attribute get displayed in Model Explorer, but it does not get highlighted.

When selecting an element in Model Explorer the saame element does
not get selected/highlighted in the diagram.
Comment 1 Camille Letavernier CLA 2013-11-14 05:19:04 EST
The ModelExplorer#reveal method depends on the Guava API > 10.0.1.

3 different versions of Guava are available in Eclipse. Because the dependency is not strict, Papyrus uses Guava 11.0.0, in which some deprecated APIs have been removed. The ModelExplorer depends on them.

Fix in 79dcffad1cf3a3df5949eb6befad9847c9082c1f:

The ModelExplorer now has an explicit dependency to Guava 10.0.1 (Excluding newer versions)

As this is a runtime dependency issue, I still need to verify if the issue is properly fixed after an update. I don't close the bug yet
Comment 2 Camille Letavernier CLA 2013-11-15 07:08:09 EST
Bug 419591 is another symptom of the same issue.

The whole model explorer selection display is broken.

There is a different issue for the diagram (When selecting an element in the ModelExplorer, it isn't highlighted in the diagram). It doesn't seem to be related.
Comment 3 Camille Letavernier CLA 2013-11-15 07:35:50 EST
> There is a different issue for the diagram (When selecting an element in the ModelExplorer, it isn't highlighted in the diagram). It doesn't seem to be related.

This part of the bug is a change in the behavior of the Eclipse Platform in Luna (Eclipse 4.4).

The IWorkbenchPage used to delegate the "Adapter" resolution to the Active Part. This is not the case anymore (The concrete implementation of the WorkbenchPage doesn't implement IAdaptable anymore)

The implementation of the Papyrus service resolution helper has been changed accordingly. Fixed in 8679ab48de78be75e277aa0c18c17ac6595e2404, pushed to master (This only fixes the synchronization from ModelExplorer to Diagram).
Comment 4 Andreas Muelder CLA 2013-11-15 11:16:20 EST
I tracked down this issue to the creation of TreeViewerFocusCellManager in the CustomCommonViewer class, that creates the TreeViewer for the Model Explorer.
When this class is used, the link with editor is broken. Hoewever, this class is required to activate the direct editing via keyboard since the keyboard event does not contain a location where the ViewerCell can be calculated from.

Since the default activation key F2 can not be used there because it triggers the rename element action I think it is a good idea to activate the direct editor via double click - this would fix this problem, too.
Comment 5 Andreas Muelder CLA 2013-11-15 11:17:30 EST
Created attachment 237494 [details]
Proposed patch to open direct editing on double click in Model Explorer
Comment 6 Ansgar Radermacher CLA 2014-02-09 06:24:05 EST
*** Bug 419591 has been marked as a duplicate of this bug. ***
Comment 7 Ansgar Radermacher CLA 2014-02-09 06:31:09 EST
andreas, thanks for the patch and the problem analysis. I prefer not to use a double click, since it also opens the tree element. The patch pushed with commit cca01ab216701a80935ed147df7c950862271616 enables editing via F3 and also shift+F2 (as F2 is already used for renaming). I don't know, which of the options we want to keep, but since this bug is blocking two others, I want to get something pushed rather quickly.
I think it would be good, if renaming would later-on also open an in-tree editor instead of a pop-up.
Toni, can you please re-check?
Comment 8 Toni Siljamäki CLA 2014-02-09 15:03:20 EST
I just downloaded the latest nightly Luna 1.0.0.v201402091226.

Not sure exactly what you ask me to check wrt the discussion above on
F2, click, shift and so on, so I checked the "link with editor" problem 
on our network models + some other models and...

Halleluja, it works again! :)

It works both when clicking in a diagram and getting the element focused in on
and highlighted in the Model Explorer, and when clicking on an element in
Model Explorer and getting it highlighted in an open diagram.

But... It doesn't work for elements in a diagram which have been
dragged-and-dropped from an imported model. This is however a slightly
different and separate issue, so this bug can be closed. :)

But I think there should be a separate bugzilla opened for this new issue on
highlighting elements also in imported models, and that new bugzilla report
should also cover testing on fragmented models.
Comment 9 Ansgar Radermacher CLA 2014-02-10 05:36:53 EST
It's true that the link is not working for imported elements. I agree that this is a different issue (Camille, is there already a bug on this - if not, can you please create one).

With regard to the xtext integration, I pushed commit 937aa8afbdc6acf396f04c67ad752c78f59026f4:
The xtext editor is now opened with the standard F2 key, i.e. the rename popup window will not open for elements handled by xtext. In the moment, this is the case for Properties only. When the xtext integration will cover more elements, the filter condition needs to be adjusted in the RenameNamedElementsHandler.

I will close this bug and handle successive xtext integration steps in the context of bug 315231
Comment 10 Camille Letavernier CLA 2014-02-10 06:50:08 EST
See Bug 360092: [Model Explorer] revealSemanticElement doesn't work with imported package

It might be fixed by either Bug 426360 or the refactoring of resources management in Papyrus in Bug 406234 (or any other resource-management-related bug)
Comment 11 Camille Letavernier CLA 2014-02-19 11:26:22 EST
*** Bug 405572 has been marked as a duplicate of this bug. ***
Comment 12 Camille Letavernier CLA 2014-02-19 11:26:45 EST
*** Bug 428537 has been marked as a duplicate of this bug. ***