Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Java (or other language) editor within another editor?
Java (or other language) editor within another editor? [message #296322] Tue, 20 December 2005 11:38 Go to next message
Eclipse UserFriend
Originally posted by: kwpeck.mersoft.com

We have an editor that is not file based (used data from a database)
than needs to show some script code within its editor. I have all the
main non-file based editor guts working but is it possible to have an
editor within an editor?

I have read the issues with Eclipse int that you can't edit a file that
is not part of the a workspace. We are doing a full RCP for this
project. Is it possible for me to add a temp file to the workspace? Is
it possible to fire up an editor with an external file?

Are there any third party coloring editors that I can use that will
allow me to define a grammer to at least get reasonable coloring while
they are editing? I am not worried about the compile and run cycle for
this script, just colored editing.
Re: Java (or other language) editor within another editor? [message #296325 is a reply to message #296322] Tue, 20 December 2005 13:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

Lots of questions :-)

What do you mean by 'an editor within an editor'? Neither Editors nor Views nest, so I suspect that the answer is 'no'. However, you might mean something different like 'is it possible to treat some parts of the document differently from others' e.g. assembler code in a c program.

There's no reason why you can't add a temporary file to the Eclipse workspace, then obtain your data from a remote source, dump it in, and then squirt it back when it's saved. Most of the API is set up to assume that the file lives in the workspace; however, (a) there's an editor that works around this hack to open up an editor for a file outside of the workspace (but most other APIs choke on it), and (b) it's fairly easy to set up a linked resource (i.e. it appears in the workspace, but actually exists outside the workspace). I'd recommend (b) if you're going down that route.

As for editor colouring with grammer; it's possible but I don't know of one. Most of the editors colouring is hand-coded; but then it's relatively easy to create your own colouring example whilst still having all the editor goodness. Take a look at the Example XML editor (downloadable from the Eclipse examples pack) to see how it works. It's actually relatively easy provided that you don't have a context sensitive grammar (e.g. keywords are always keywords, you don't need to colour blocks etc.)

Think I got them all...

Alex.
Re: Java (or other language) editor within another editor? [message #296327 is a reply to message #296325] Tue, 20 December 2005 13:40 Go to previous message
Eclipse UserFriend
Originally posted by: kwpeck.mersoft.com

I think you are one the right track with the sample XML editor.
Basically I need a coloring text editor based on StyledEditor that I can
place like any other widget inside my Eclipse editor based class.

Alex Blewitt wrote:
> Lots of questions :-)
>
> What do you mean by 'an editor within an editor'? Neither Editors nor Views nest, so I suspect that the answer is 'no'. However, you might mean something different like 'is it possible to treat some parts of the document differently from others' e.g. assembler code in a c program.
>
> There's no reason why you can't add a temporary file to the Eclipse workspace, then obtain your data from a remote source, dump it in, and then squirt it back when it's saved. Most of the API is set up to assume that the file lives in the workspace; however, (a) there's an editor that works around this hack to open up an editor for a file outside of the workspace (but most other APIs choke on it), and (b) it's fairly easy to set up a linked resource (i.e. it appears in the workspace, but actually exists outside the workspace). I'd recommend (b) if you're going down that route.
>
> As for editor colouring with grammer; it's possible but I don't know of one. Most of the editors colouring is hand-coded; but then it's relatively easy to create your own colouring example whilst still having all the editor goodness. Take a look at the Example XML editor (downloadable from the Eclipse examples pack) to see how it works. It's actually relatively easy provided that you don't have a context sensitive grammar (e.g. keywords are always keywords, you don't need to colour blocks etc.)
>
> Think I got them all...
>
> Alex.
Previous Topic:Projects do not build automatically after importing in workspace
Next Topic:Where is the code that reads a plugin manifest
Goto Forum:
  


Current Time: Thu May 08 07:32:49 EDT 2025

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

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

Back to the top