archimatetool / archi-scripting-plugin

jArchi - Scripting for Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
122 stars 33 forks source link

[Feature request] open and/or select programmatically a view in the UI #121

Closed rchevallier closed 8 months ago

rchevallier commented 1 year ago

jArchi allows to manipulate concepts and visual object. It also add the possibility to manipulate a model in the UI (model.openInUI(), model.setAsCurrent()). But it is missing verbs to manipulate a view in the UI.

Use case example:

Proposition

Most important verb would be to open/show/select a view in the UI:

view.open() - open a view editor in UI (and make it current?)
or
view.setAsCurrent() - open a view editor in UI and make it current

or any other syntax

Other interesting verbs could be:

view.isOpened() - true if opened
view.isCurrent() - true if opened and current
view.close() - close the view in UI
model.listOpenedViews() - list all opened views (equivalent to $("view").filter(v => v.isOpened())
Phillipus commented 1 year ago

Hi, I can see that view.openInUI() (named to match model.openInUI()) might be useful, as well as view.close(), but there is no notion of a "current view" as there is a "current model".

Not sure how useful view.isOpened() is given that you if you need to know that to decide whether you should open it you could just call view.openInUI() and it will open if closed, and ignore it if already open. Same for view.close().

So, an easy win would be to consider view.openInUI() and view.close().

rchevallier commented 1 year ago

Thanks for the feedback.

The idea behind is for the script to force the UI to put a specific view in front to the user, so he can see it, either at end of the script, or ideally also during execution of the script (ie: for the user to observe something the script has made, and validate interactively it)

So if there is to way to have a "current"=focused view, how to do that? view.close() followed by view.openInUI() ?

Phillipus commented 1 year ago

view.openInUI() will put the focus on that view.

rchevallier commented 1 year ago

Perfect then

Phillipus commented 8 months ago

Implemented in jArchi 1.5.0.