Confirmation? Not possible to modify the selection with jArchi

Started by rchevallier, November 17, 2021, 13:06:48 PM

Previous topic - Next topic

rchevallier

Hello all

Idea I have is to have a jArchi script which would select some specific elements based on some properties values  among the one in a current view. 
My understanding this is not possible (ie: change the selection with JArchi)
Or is there a way?

Thanks

Phil Beauvoir

November 17, 2021, 13:38:22 PM #1 Last Edit: November 17, 2021, 13:41:23 PM by Phil Beauvoir
This is all internal Eclipse stuff. The following is how you'd do it theoretically (assuming that a View was open, otherwise you get a Null Pointer Exception):

workbench.activeWorkbenchWindow.activePage.activeEditor.selectObjects(objects);
The problem is passing an array of objects to the active editor, as it only works with internal Archi model classes. jArchi uses proxy classes that wrap the internal model classes. I think it might be possible to get them via:

object.getEObject()
through some kind of JS introspection, but I can't remember how to do that. I think Herve did it once. See https://forum.archimatetool.com/index.php?topic=644.msg3594#msg3594
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate