Capella Project Explorer / Link with Editor

Hello,
I notice that Capella Project Explorer links elements even if “Link with Editor” button is disabled.
It only happens in specific case: in my own specific tab in the Properties view. In this tab, I display some elements of my model and I can edit them with an Xtext editor from this tab.
I edit an element with the Xtext editor, then I close the Xtext editor and just after that the element edited is selected in the Capella Project Explorer even if the “link with Editor” button is disabled.
After a debug session, I noticed that commandStackSelectionChanged(ISelection selection) is called in
https://git.polarsys.org/c/capella/capella.git/tree/core/plu gins/org.polarsys.capella.core.platform.sirius.ui.navigator/ src/org/polarsys/capella/core/platform/sirius/ui/navigator/v iewer/NavigatorEditingDomainDispatcher.java
when the Xtext editor is closing.
I don’t know why this code is called even though the “Link with Editor” button is disabled.
Best regards,

After another investigation session, I found that in org.polarsys.capella.core.platform.sirius.ui.navigator.view. CapellaCommonNavigator.commandStackSelectionChanged(ISelecti on selection) a selectReveal(selection) is done without regard to the linking state
@Override
public void commandStackSelectionChanged(ISelection selection) {
boolean enabled = true;
if (selection instanceof IStructuredSelection) {
TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(((IStructuredSelection) selection).getFirstElement());
enabled = ActiveSessionManager.getInstance().isEnabledContentNotificat ions(domain);
}
if (enabled) {
selectReveal(selection);
}
}
May be a test should be done before selectReveal(selection) to test if the linking is enabled.
This test could be something like this:
@Override
public void commandStackSelectionChanged(ISelection selection) {
if (isLinkingEnabled()) {
boolean enabled = true;
if (selection instanceof IStructuredSelection) {
TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(((IStructuredSelection) selection).getFirstElement());
enabled = ActiveSessionManager.getInstance().isEnabledContentNotificat ions(domain);
}
if (enabled) {
selectReveal(selection);
}
}
}

Copyright © Eclipse Capella, the Eclipse Capella logo, Eclipse and the Eclipse logo are Trademarks of The Eclipse Foundation.