Closed gxpcluster closed 5 months ago
Archi already has an event handler - the Eclipse Modelling Framework (EMF) eCore framework. Every model change sends an event that is handled by the UI or another handler. This can be used in Archi plug-ins...if the plug-in is well-behaved and properly places any changes to the model on the Undo/Redo stack.
jArchi is a wrapper around Archi's commands and implements things so that it is well behaved and creates proper Undo/Redo command stack events. If this was exposed to downstream scripts the resulting behaviour would be unpredictable.
So, the short answer is, I won't be implementing this in jArchi because of the reasons above and, even if it were possible, would take a lot of time and effort. But thanks for the idea!
Thank you @Phillipus. I have situations where it would be very convenient to have a script triggered by certain user actions. For example, when a user adds a new concept to a diagram or changes an existing concept, I need to record in a text file what happened - the ID of the added or changed concept. So far, I haven't figured out how to do this without running the script manually. Unfortunately, I'm not good at Java to write a separate plugin. Thanks for explaining how events work in Archi.
How hard is it to add event handlers to Archi and jArchi? It would be great to have such a feature at least for basic events: changing the concept on the diagram, opening the model, closing the model, changing the diagram... As far as I understand it, this could be done as follows:
Thanks!