Getting started with GEF? [message #74318] |
Wed, 02 April 2003 16:59  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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 #74480 is a reply to message #74462] |
Thu, 03 April 2003 13:00  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03515 seconds