Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » XML Tree with GEF
XML Tree with GEF [message #214605] Wed, 19 April 2006 08:31 Go to next message
Eclipse UserFriend
Originally posted by:

I am new to GEF and want to represent an xml-file as a tree with GEF. Should I create a model or is it possible to do it directly like, say, it is in swing?

Are there examples for it?
Re: XML Tree with GEF [message #214847 is a reply to message #214605] Mon, 24 April 2006 14:42 Go to previous message
Eclipse UserFriend
Originally posted by:

Hi Shabaltas,

You can use a JFaces TreeViewer or a GEF TreeViewer.

To use the second one, you have to use the duo Model-EditPart, and
Policies to do action in the widget created !!

If you use the first one, you can do it without a model !!!

With GEF :

public class MyTreeEditor extends GraphicalEditorWithPalette {

public void createPartControl(Composite parent) {
gefTreeViewer = new TreeViewer();
//The factory who create the edipart in relation of the model to
use !!

With JFaces :

viewer = new TreeViewer();

XmlEditorContentProvider xmlProvider = new

XmlEditorLabelProvider labelProvider = new XmlEditorLabelProvider();

MyNode root = new MyNode("root");
MyNode fils = new MyNode("titi");
MyNode fils2 = new MyNode("tutu");
fils.addChild(new MyNode("test"));


Have fun

Previous Topic:Choosing constructor to create component instances
Next Topic:Passing Node Instance to EditPolicy
Goto Forum:

Current Time: Fri Dec 09 07:10:19 GMT 2022

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

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

Back to the top