Skip to main content



      Home
Home » Eclipse Projects » GEF » Getting started with GEF?
Getting started with GEF? [message #74318] Wed, 02 April 2003 16:59 Go to next message
Eclipse UserFriend
Originally posted by: acme.us.ibm.com

I'm trying to get started with GEF, and between the documentation and the examples, I'm very confused. I'd like to simply create an editor plugin that displays an SWT Label that I can drag around on the screen.

It seems like I need to create something like:

public class LabelViewer extends AbstractEditPartViewer
{
public Control createControl(Composite parent)
{
Label label = new Label(parent, SWT.WRAP);
label.setText("My test label");
return label;
}
}

Am I on the right track, and if so, what is the next step? I looked at GraphicalEditor, but it doesn't seem that will work since it uses GraphicalViewer which is not what I want.

Bryan
Re: Getting started with GEF? [message #74337 is a reply to message #74318] Wed, 02 April 2003 21:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

GEF uses lightweight figures to build a diagram. Sometimes SWT controls are
used to edit a text value, but Labels are not really used.

Your starting point should be your model. You need a model that is then
displayed using figures. Some other users have said that they want the
Figures to the model, and they want to persist certain properties of the
figures. While this approach could be taken, it isn't as clean or widely
applicable as the model view split that GEF requires.

There are a few pictures in the online documentation for GEF that might
communicate the overall picture. Install GEF into eclipse, and choose
help->Help Contents

"Bryan Hunt" <acme@us.ibm.com> wrote in message
news:20030402160526988-0600@news.eclipse.org...
> I'm trying to get started with GEF, and between the documentation and the
examples, I'm very confused. I'd like to simply create an editor plugin
that displays an SWT Label that I can drag around on the screen.
>
> It seems like I need to create something like:
>
> public class LabelViewer extends AbstractEditPartViewer
> {
> public Control createControl(Composite parent)
> {
> Label label = new Label(parent, SWT.WRAP);
> label.setText("My test label");
> return label;
> }
> }
>
> Am I on the right track, and if so, what is the next step? I looked at
GraphicalEditor, but it doesn't seem that will work since it uses
GraphicalViewer which is not what I want.
>
> Bryan
Re: Getting started with GEF? [message #74462 is a reply to message #74337] Thu, 03 April 2003 12:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: acme.us.ibm.com

In <b6g6jc$vns$1@rogue.oti.com> Randy Hudson wrote:
> GEF uses lightweight figures to build a diagram. Sometimes SWT
> controls are used to edit a text value, but Labels are not really used.
>
> Your starting point should be your model. You need a model that is
> then displayed using figures.

Does this mean that GEF can only display / manipulate org.eclipse.draw2d.
Figure instances? This seems to contradict the documentation that says:

"GEF also provides support for SWT TreeItems, but support for other
visuals can easily be added."

This started me down the path of creating my own "visual" for a SWT
Label. As I started down this path, I got lost quickly in what exactly
I needed to do and where to go next.

I already have a model, but left it out of the discussion as it's
confidential.

BTW, I've read the docs multiple times, and find them to be a good
overview, but not sufficient to get started writing code.

Bryan
Re: Getting started with GEF? [message #74480 is a reply to message #74462] Thu, 03 April 2003 13:00 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> Does this mean that GEF can only display / manipulate org.eclipse.draw2d.
yes
> Figure instances? This seems to contradict the documentation that says:
>
> "GEF also provides support for SWT TreeItems, but support for other
> visuals can easily be added."

There is a GraphicalViewer which manipulates Figures, and a TreeViewer which
manipulates TreeItems. They are two separate types of viewers with the same
MVC design (model - editpart- visual), but the visual parts differ. There
is no way to mix them.
Previous Topic:Is GEF right for this task
Next Topic:GEF Hello 6 tutorial does not compile
Goto Forum:
  


Current Time: Sat May 10 06:43:01 EDT 2025

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

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

Back to the top