archi-scripting-plugin icon indicating copy to clipboard operation
archi-scripting-plugin copied to clipboard

Add jArchi support for CheatSheets

Open jbsarrodie opened this issue 5 years ago • 6 comments
trafficstars

jArchi makes it possible to automate a lot of things. I think that, together with Cheat Sheets (which are an interesting but motly hidden feature of Archi) this would allow people to create really amazing things.

Thanks to @Phillipus's help, I've started to work on jArchi support for Cheat Sheets, and this has been much simpler than expected. So I've just submited some code in a new cheatsheets branch.

This code provides a very simple RunArchiScriptCheatSheetAction action which will run the script passed as an argument. The argument must contains the script path relative to __SCRIPTS_DIR__.

A basic demo cheat sheet has been included. It expects the user to have created a demo.ajs script beforehand in the root scripts folder.

I'm planning to update this code so that the action takes another parameter to define the "scope" of the script, so that it becomes possible to run a script:

  • through an absolute path
  • included in another plugin (so this might adresses #82)
  • by providing the actual code inside the cheatsheet itself

So opening this issue to discuss this feature.

jbsarrodie avatar Nov 18 '20 12:11 jbsarrodie

Interesting.

demo.xml file is missing, though

Might be better to use:

Require-Bundle: org.eclipse.ui.cheatsheets

rather than

Import-Package: org.eclipse.ui.cheatsheets

Phillipus avatar Nov 18 '20 13:11 Phillipus

demo.xml file is missing, though

In fact lots of files are missing (unfortunately I have to use TortoiseGit, which not that bad but not that good than SmartGit). I've just commited the other files.

jbsarrodie avatar Nov 18 '20 13:11 jbsarrodie

Might be better to use:

Require-Bundle: org.eclipse.ui.cheatsheets

rather than

Import-Package: org.eclipse.ui.cheatsheets

Done

jbsarrodie avatar Nov 18 '20 13:11 jbsarrodie

Also, try to remove the ``org.eclipse.core.resources.prefs` file. I don't know which part of Eclipse adds it.

Phillipus avatar Nov 18 '20 13:11 Phillipus

Also, try to remove the ``org.eclipse.core.resources.prefs` file. I don't know which part of Eclipse adds it.

Done. In fact this is related to another change we have to make in jArchi: the template for new scripts should be in UTF-8, or else people might have some troubles. I'll submit it on master later.

jbsarrodie avatar Nov 18 '20 13:11 jbsarrodie

I'll submit it on master later.

I've done it.

Phillipus avatar Nov 18 '20 13:11 Phillipus