|Re: Can I create scripts that I can run inside the Eclipse Editor? [message #1690004 is a reply to message #1690001]
||Mon, 03 November 2014 19:44
| Christian Pontesegger
Registered: July 2009
Location: Graz, Austria
always glad to see people using the project. Lets see about your questions:
> Any plans to allow scripts to be written in java? Personally I'd prefer it.
I'll take this one first as it helps answering some of the other questions.
You may already mix Java code with JS. Only drawback: you have to provide FQN eg:
var file = new java.io.File("C:\\")
As JS runs on the JRE currently executing eclipse you may interact with the whole java class library along with any public eclipse API.
> Does EASE have the ability to let me store these regex edits as scripts and run them inside the editor as if they were part of it?
You may create a script in your workspace (or anywhere on your file system) that contains your regEx, which processes a certain file containing your text data. So you cannot mix script code and your sample data in the same file very well. (In fact you could by quoting your whole data content as a string literal resulting in a huge script file modifying itself, but that not a real world use case I think.)
Look at the Resources module which allows to read/write files. Mix it with an open dialog (also from the resources module) and add some java code for your regexp parsing.
> Can I interact with, for example, the find/replace dialog from a script?
Yes, definitely. But you need to look at the find/replace API from eclipse for that. Currently EASE has no convenience methods for that.
> Can I capture them from keystrokes, as in MS Word's record macro function?
No, not to my knowledge. The script shell view allows to record commands you type into it (use rightmost toolbar button), but this will not capture any keyboard shortcuts or whatever data you provide in dialogs or other views.
> Help me get started and I'll gladly contribute examples.
There exists an (currently empty) git repository for examples. Feel free to push example scripts there!
come back if you have further questions
Powered by FUDForum
. Page generated in 0.03994 seconds