archimatetool / archi-scripting-plugin

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

[Idea] expose the script menu into the main Archi Window's menu #113

Closed jbsarrodie closed 1 year ago

jbsarrodie commented 1 year ago

Hi,

Would it be possible to add a "Script" menu to the main Archi Window. As for "Collaboration", it could group jArchi's key features (show/hide script manager/console, run scripts, associate key bindings -- see #62).

This main menu could look like this:

 ───────┬──────────────┬───────────┬───────┬────┬────────────────────────
        │Collaboration │Scripts    │Window │Help│
 ───────┴──────────────┼───────────┴───────┴────┤
                       │Run                    >├─────────────────────┐
                       ├────────────────────────┤                     │
                       │Edit Key bindings       │                     │
                       ├────────────────────────┤   auto-generated    │
                       │Toggle Script Manager   │   list of scripts   │
                       │Toggle Script Console   │ (same as contextual │
                       └────────────────────────┤        menu)        │
                                                │                     │
                                                │                     │
                                                │                     │
                                                └─────────────────────┘
Phillipus commented 1 year ago

Sorry that's not possible...

scripts

...yep can do that. :-)

Although "Edit Key Bindings" is not really a jArchi thing. It just opens up the general Eclipse key bindings dialog which is also accessible from Preferences. As it is quite generic it might be better to have it in the "Help" menu. I put it in the context menu of the Script manager because it's the right place to quickly access it when you're assigning a script to a key binding. Another reason not to have it in the "Scripts" main menu is this feature depends on having Archi 5. In the context menu I can say "if Archi version >= 5 then show menu" but I can't do that in the main top menu.

Phillipus commented 1 year ago

I'm not sure we need the "Run" sub-menu:

scripts2

jbsarrodie commented 1 year ago

Sorry that's not possible...

;-)

As it is quite generic it might be better to have it in the "Help" menu.

Agree

I'm not sure we need the "Run" sub-menu:

Well... In theory no, but I'm afraid that without it someone will complain that it's not explicit and he/she was expecting this menu to edit script and not run it. It might also make the main script menu too big if someone have lots of scripts without any folders.

Phillipus commented 1 year ago

It might also make the main script menu too big if someone have lots of scripts without any folders.

Then the sub-menu would also be big.

Phillipus commented 1 year ago

Run sub-menu or no Run sub-menu? I don't mind. the only issue is this one:

that without it someone will complain that it's not explicit and he/she was expecting this menu to edit script and not run it.

jbsarrodie commented 1 year ago

Then the sub-menu would also be big.

~Yes, but in this case this doesn't "hide" other enties like "Script Manager" and "Script Console". And if we decide later to add other things (such as "Refesh UI when running scripts" checkbox), then they will be visible at all time.~

Run sub-menu or no Run sub-menu?

~I think it makes sens to have it to make it explicit and not clutter for people with lots of scripts.~

Edit: see next comment

jbsarrodie commented 1 year ago

I've had a chat with a colleague who had nice suggestions:

I think I agree with his suggestions, so (if you agree), let's do it this way:

 ───────┬──────────────┬───────────┬───────┬───────────────┬─────
        │Collaboration │Scripts    │Window │Help           │
 ───────┴──────────────┼───────────┴───────┴───────────────┼─────
                       │    Script Manager                 │
                       │    Script Console                 │
                       ├───────────────────────────────────┤
                       │[x] Refresh UI When Running Scripts│
                       ├───────────────────────────────────┤
                       │    auto-generated list of scripts │
                       │    (same as contextual menu)      │
                       └───────────────────────────────────┘
Phillipus commented 1 year ago

Okey dokey...