Can I create scripts that I can run inside the Eclipse Editor? [message #1690001] |
Fri, 31 October 2014 10:49  |
Eclipse User |
|
|
|
I have been waiting and hoping for a Scripting capability in Eclipse since I first started using it in 2001 (IBM WSAD4).
I am now retired (from IBM WebSphere development) and my chosen retirement activity is working on many files which are raw OCR text from a bookscanner. I use the eclipse Editor to remove as many of these errors as possible before I move the files to MS Word. I do this because I can use real regular expressions to make complex edits -- MS Word's wildcard syntax is a weak subset of regex.
Each of these regex edits has to be typed in again for every file.
So:
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?
Can I interact with, for example, the find/replace dialog from a script?
Can I capture them from keystrokes, as in MS Word's record macro function?
Any plans to allow scripts to be written in java? Personally I'd prefer it.
Help me get started and I'll gladly contribute examples.
Chris Gage
www.ibiblio.org/britishRaj
|
|
|
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 14:44   |
Eclipse User |
|
|
|
Hi Chris,
always glad to see people using the project. Lets see about your questions:
Quote:
> 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:\\")
if (file.exists())
print("found...")
As JS runs on the JRE currently executing eclipse you may interact with the whole java class library along with any public eclipse API.
Quote:
> 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.
Quote:
> 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.
Quote:
> 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.
Quote:
> 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
Christian
|
|
|
|
|
Re: Can I create scripts that I can run inside the Eclipse Editor? [message #1690031 is a reply to message #1690029] |
Tue, 24 February 2015 16:38  |
Eclipse User |
|
|
|
Hi Christian,
Sorry for not giving much background. Wildly hoped that it was a famous error :)
Anyway, i created a plugin project (X) in my workspace and i run the plugin along with the rest of the plugins in my target. In the launched eclipse instance, i can access all the public APIs that are in my target using the FQN as mentioned in my/your previous comment in JS.
But when trying to access the APIs (using FQN) of the plugin project (X) that i created, throws up this Ecma error.
Is it because, of the state of the plugin that it might not be active ? How is this project different from the others in target .. all are run in the launched eclipse instance..
or in a larger context, is it necessary that i expose java only via "modules" of EASE ?
|
|
|
Powered by
FUDForum. Page generated in 0.04015 seconds