Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Universal tree-based code editor with custom tree node sub menus(tree-based editor, outliner, model tree, code browser, emf, rcp, gmf, dsl, xtext, JFace text, JFace tree, model tree, partitioning, tree node context menu, eclipse, stand alone, user defined language)
Universal tree-based code editor with custom tree node sub menus [message #730819] Thu, 29 September 2011 09:01 Go to next message
Stefan Eidelloth is currently offline Stefan Eidelloth
Messages: 29
Registered: September 2011
Junior Member
Hi together,

I am new to eclipse and would like to have a universal tree-based text editor. Could you please give me hints if something like this already exists or which components I could use / tutorials I can start with. Eclispe seems to offer a lot of possibilities to realize such a thing. I am somehow lost in these possibilies and it would be very nice if you could give me some orientation.

Here is my vision:

- Code editor with two views: a tree-outline and a script window.
- If I change the code (e.g. add a new function), the outline is automatically updated.
- If I change the tree (add new child nodes ect.), the code is updated.
- Each tree node has a context menu (shown with right mouse click) that depends on the type of the node.
- There are external files that define:
+ The grammar of the programming language / the tree node types
+ The context menus of the tree nodes
+ The actions of the tree node menu items

- The tree context menus would make it very easy to learn the user defined programming language

- It should be a stand allone application (maybe rcp that can be extended with new plugins for custom languages, plugins for graphical views (VTK) ect.)

An application example would be the modelling of geometries. The text view would show following code:

Geometry 1
Name = "BaseGeometry"

Rectangle 1
Name = "Base Rectangle"
Coordinates = [0,0, 100, 100]
End

Rectangle 2
Name = "Extra Rectangle"
Coordinates = [100,100, 10, 10]
End

End

The tree-outline would show a tree representation of this code.


The tree node "Geometry1" would have a sub menu with following options:
+ Add rectangle
+ Add circle
+ Add triangle
+ Copy
+ Delete
+ Paste
+ Help

The tree node "Base Rectangle" would have a sub menu with
+ Edit
+ Copy
+ Delete
+ Help

The "Edit" action of the "Base Rectange" tree-node context menu would show a dialog where the coordinates of the rectangle can be entered.

(The root node would have entries like "Add Geoemtry" ect.)

The "univeral" tree-based editor could also be used as XML editor, Java editor, editor for finite elment simulation scripts, ... if the external grammar-, action- ect. files are set accordingly.

Sunny regards,

Stefan


tree-based editor, outliner, model tree, code browser, emf, rcp, gmf, dsl, xtext, JFace text, JFace tree, model tree, partitioning, tree node context menu, eclipse, stand alone, user defined language

[Updated on: Mon, 03 October 2011 11:29]

Report message to a moderator

Re: Universal tree-based code editor with custom tree node sub menus [message #730922 is a reply to message #730819] Thu, 29 September 2011 14:34 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
Have a look at the XText project. It allows you to define your own grammar and then have the editors generated for you automatically.
Re: Universal tree-based code editor with custom tree node sub menus [message #730937 is a reply to message #730922] Thu, 29 September 2011 15:09 Go to previous messageGo to next message
Stefan Eidelloth is currently offline Stefan Eidelloth
Messages: 29
Registered: September 2011
Junior Member
The XText project allows to display the code as tree. Does it also support context menus for the tree that depend on the node type and changes of the code with tree actions? I could not find an example for that.

[Updated on: Thu, 29 September 2011 15:12]

Report message to a moderator

Re: Universal tree-based code editor with custom tree node sub menus [message #731546 is a reply to message #730937] Sat, 01 October 2011 17:01 Go to previous messageGo to next message
Stefan Eidelloth is currently offline Stefan Eidelloth
Messages: 29
Registered: September 2011
Junior Member
Any more suggestions?
Re: Universal tree-based code editor with custom tree node sub menus [message #731554 is a reply to message #731546] Sat, 01 October 2011 17:30 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26130
Registered: July 2009
Senior Member
I don't think there's anything else that even comes close to what you're
asking about.

On 01/10/2011 10:01 AM, schnumbl wrote:
> Any more suggestions?
Re: Universal tree-based code editor with custom tree node sub menus [message #731648 is a reply to message #731554] Sun, 02 October 2011 08:52 Go to previous messageGo to next message
Stefan Eidelloth is currently offline Stefan Eidelloth
Messages: 29
Registered: September 2011
Junior Member
Ok, thank you. So I know I have to try xtext as starting point.
Re: Universal tree-based code editor with custom tree node sub menus [message #734711 is a reply to message #731648] Sun, 09 October 2011 12:47 Go to previous messageGo to next message
Stefan Eidelloth is currently offline Stefan Eidelloth
Messages: 29
Registered: September 2011
Junior Member
Here is finally a "proof of principle" example based on xtext:
- The outline includes a dynamic menu.
- It also has custom icons that depend on the type of the node.
- The actions of the menu modify the source code.
- The zipped example workspace includes a rcp product to produce a stand allone text editor.

http://matameko.wikispaces.com/file/view/mydsl.png/271471374/mydsl.png

http://www.file-upload.net/download-3853661/workspace.zip.html

Thanks a lot to the xtext developers and all folks here answering my annoying questions! Smile

[Updated on: Thu, 03 November 2011 13:51]

Report message to a moderator

Re: Universal tree-based code editor with custom tree node sub menus [message #832019 is a reply to message #734711] Thu, 29 March 2012 16:54 Go to previous messageGo to next message
Heinrich Müller is currently offline Heinrich Müller
Messages: 10
Registered: March 2012
Junior Member
Could you upload it again, that would be _really_ helpful. Thanks!
Re: Universal tree-based code editor with custom tree node sub menus [message #833624 is a reply to message #832019] Sat, 31 March 2012 20:05 Go to previous messageGo to next message
Stefan Eidelloth is currently offline Stefan Eidelloth
Messages: 29
Registered: September 2011
Junior Member
You can find it here:
www.eclipse.org/forums/index.php/m/754563/#msg_754563
Re: Universal tree-based code editor with custom tree node sub menus [message #837538 is a reply to message #833624] Thu, 05 April 2012 20:07 Go to previous message
Heinrich Müller is currently offline Heinrich Müller
Messages: 10
Registered: March 2012
Junior Member
Thanks. Looks good.
Previous Topic:Error launching Eclipse
Next Topic:Need Help for Total Dummies
Goto Forum:
  


Current Time: Wed Oct 22 04:50:33 GMT 2014

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

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