Bug 581541

Summary: EcoreUIUtil.openEditor() with OpenStrategy.OPEN_ON_RESOURCE strategy uses OpenStrategy.OPEN_ON_OBJECT instead
Product: [Automotive] Sphinx Reporter: Andras Janko <andras.janko>
Component: CoreAssignee: Project Inbox <sphinx-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: balazs.grill
Version: 0.13.0   
Target Milestone: 0.13.1   
Hardware: All   
OS: All   
Whiteboard:

Description Andras Janko CLA 2023-02-16 12:57:19 EST
EcoreUIUtil.openEditor(...) methods could be a very useful utility to find and open the related editor for a model element (EObject). The OpenStrategy.OPEN_ON_RESOURCE is supposed to open the editor of the resource of the model element and select the selection to the model element in that editor.

However, the int values of org.eclipse.sphinx.emf.ui.util.OpenStrategy#OPEN_ON_RESOURCE and OpenStrategy#OPEN_ON_OBJECT are both 0. Because of this, the EcoreUIUtil.openEditor() will always use the OPEN_ON_OBJECT strategy, even when the OPEN_ON_RESOURCE strategy is passed as parameter.

I recommend to set distinct values for the two strategies, which would fix this issue.
Comment 1 Balazs Grill CLA 2024-05-07 01:00:31 EDT
This issue will be migrated to gitlab.