1+ /**
2+ * SysML 2 Pilot Implementation
3+ * Copyright (C) 2025 Model Driven Solutions, Inc.
4+ *
5+ * This program is free software: you can redistribute it and/or modify
6+ * it under the terms of the GNU Lesser General Public License as published by
7+ * the Free Software Foundation, either version 3 of the License, or
8+ * (at your option) any later version.
9+ *
10+ * This program is distributed in the hope that it will be useful,
11+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+ * GNU Lesser General Public License for more details.
14+ *
15+ * You should have received a copy of the GNU Lesser General Public License
16+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17+ *
18+ * @license LGPL-3.0-or-later <http://spdx.org/licenses/LGPL-3.0-or-later>
19+ *
20+ * Contributors:
21+ * Laszlo Gati, MDS
22+ */
23+ package org.omg.sysml.xtext.ui.xmi
24+
25+ import org.eclipse.xtext.ui.editor.LanguageSpecificURIEditorOpener
26+ import org.eclipse.ui.IEditorPart
27+ import org.eclipse.emf.common.util.URI
28+ import org.eclipse.emf.ecore.EReference
29+ import org.eclipse.emf.ecore.presentation.EcoreEditor
30+
31+ class EcoreEditorOpener extends LanguageSpecificURIEditorOpener {
32+
33+
34+ override protected selectAndReveal (IEditorPart openEditor , URI uri , EReference crossReference , int indexInList , boolean select ) {
35+ if (uri. fragment !== null ){
36+ val editor = openEditor. getAdapter(EcoreEditor )
37+ val eObject = editor. editingDomain. resourceSet. getEObject(uri, false )
38+ editor. selectionToViewer = #[eObject]
39+ }
40+ }
41+
42+ override protected getEditorId () {
43+ ' org.omg.sysml.lang.sysml.presentation.SysMLxEditorID'
44+ }
45+
46+ }
0 commit comments