Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Calling external commandline programs to filter data
Calling external commandline programs to filter data [message #325774] Tue, 26 February 2008 15:48 Go to next message
Eclipse UserFriend
Originally posted by: janis_papanagnou.hotmail.com

I am seeking for a way to process data from an Eclipse editor window and
save the transformed data in an external file; the data transformer is an
already existing external Unix shell program that expects as input either
a stream of data or the name of a file that contains the data.

Searching through published Eclipse plugins I found something called
"Emacsish" (to call shell programs from within Eclipse) that seems to go
in that direction, but it's not quite what I need it seems.

So my newbie question is; is there any plugin that makes it possible to
filter the Eclipse editor contents by using an external commandline filter
program and create a new data file from the result? Or is there any other
way how to achieve such tasks with Eclipse? Or, as a last ressort; would
it be necessary to re-implement all the external filter programs as
Eclipse plugin Java programs?

Any enlightenment and all suggestions very much appreciated!
Re: Calling external commandline programs to filter data [message #325805 is a reply to message #325774] Wed, 27 February 2008 16:02 Go to previous messageGo to next message
David Kyle is currently offline David KyleFriend
Messages: 125
Registered: July 2009
Senior Member
Janis,

If you only want to transform data during a save why not override the
IEditorPart.doSave(IProgressMonitor) and IEditorPart.doSaveAs()?

Are you transforming an existing AbstractDocument object or will you be able
to create your own?

Each call to an external unix shell process would be run from a
org.eclipse.core.runtime.jobs.Job.

The editor API is challenging learn so don't give up early.

David Kyle
http://richclientplatform.blogspot.com
Re: Calling external commandline programs to filter data [message #325821 is a reply to message #325805] Thu, 28 February 2008 09:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: janis_papanagnou.hotmail.com

David, thanks for your reply!

>If you only want to transform data during a save why not override the
>IEditorPart.doSave(IProgressMonitor) and IEditorPart.doSaveAs()?

Actually, I need a second file to create from the original data in the
Eclipse document.

>Are you transforming an existing AbstractDocument object or will you be able
>to create your own?

As an Eclipse newbie I may not quite understand what you are asking me ;-)
but I suppose I am operating on the document obtained by getDocument(),
the one displayed in the Eclipse editor window. From that data I want to
create an own document which I want to save as a copy in a file (or just
print the transformed data).

(Maybe I can add another "save file type" selection while performing the
doSaveAs() function which triggers the data transformation before saving?)

>Each call to an external unix shell process would be run from a
>org.eclipse.core.runtime.jobs.Job.

I'll have a closer look to that entry.

>The editor API is challenging learn so don't give up early.

Good to know :-)

Janis
Re: Calling external commandline programs to filter data [message #325892 is a reply to message #325821] Sat, 01 March 2008 14:23 Go to previous message
David Kyle is currently offline David KyleFriend
Messages: 125
Registered: July 2009
Senior Member
Janis,

> (Maybe I can add another "save file type" selection while performing the
> doSaveAs() function which triggers the data transformation before saving?)

That would work if you created the editor. Are you working with your own
editor or are you trying to extend an existing editor?

We created our own job deck editor that has a "raw" and "resolved" tab. We
transform the "raw" to "resolved" with a couple of IDocument and
IDocumentProvider objects.

http://richclientplatform.blogspot.com/2007/12/oil-and-gas-i ndustry-using-eclipse.html

David Kyle
http://richclientplatform.blogspot.com
Previous Topic:Regular expressions in editor
Next Topic:When to use Application with Equinox
Goto Forum:
  


Current Time: Sat Jul 27 16:37:28 GMT 2024

Powered by FUDForum. Page generated in 0.02665 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top