Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » GEF EditParts and SWT
GEF EditParts and SWT [message #69614] Wed, 12 March 2003 17:42 Go to next message
Rich Naylor is currently offline Rich NaylorFriend
Messages: 4
Registered: July 2009
Junior Member
I'm trying to create an EditPart which will display it's contents in a
"split pane" style, such as the org.eclipse.swt.custom.SashForm class does.
Looking through the docs for
org.eclipse.gef.editparts.AbstractGraphicalEditPart, an EditPart needs to
create a visual component which implements the org.eclipse.draw2d.IFigure
interface. There seems to be no relation between an IFigure component and a
SWT component. I'm wondering if I'm missing something or if what I'm trying
to do can be done. I appreciate any thoughts or comments on this. Thanks in
advance.

- Rich
Re: GEF EditParts and SWT [message #69635 is a reply to message #69614] Wed, 12 March 2003 18:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

That's correct. In order to paint handles, connections, and feedback, it
wasn't possible to support the use of heavyweight objects like an SWT
control. Everything is a figure on a Canvas. The EditPart has access to
this canvas, so if you wanted to place a "proxy" figure in the diagram, and
synchronize it with a SashForm that is parented by that cavnas, you might be
able to get that to work.

"Rich Naylor" <rich.naylor@active-endpoints.com> wrote in message
news:b4nrl3$2mq$1@rogue.oti.com...
> I'm trying to create an EditPart which will display it's contents in a
> "split pane" style, such as the org.eclipse.swt.custom.SashForm class
does.
> Looking through the docs for
> org.eclipse.gef.editparts.AbstractGraphicalEditPart, an EditPart needs to
> create a visual component which implements the org.eclipse.draw2d.IFigure
> interface. There seems to be no relation between an IFigure component and
a
> SWT component. I'm wondering if I'm missing something or if what I'm
trying
> to do can be done. I appreciate any thoughts or comments on this. Thanks
in
> advance.
>
> - Rich
>
>
Re: GEF EditParts and SWT [message #69676 is a reply to message #69635] Wed, 12 March 2003 19:12 Go to previous messageGo to next message
Rich Naylor is currently offline Rich NaylorFriend
Messages: 4
Registered: July 2009
Junior Member
If I did create a proxy figure linked to a SashForm, would I still be able
to
allow the user the ability to modify the SashForm. I would need to be able
to
add/delete child panes and change the size of the panes within the figure.

Are there any other known limitations of using this technique, or other
alternative approaches which may work better within the eclipse
architecture?

Thanks for your feedback.

- Rich

"Randy Hudson" <none@us.ibm.com> wrote in message
news:b4nu2c$4sv$1@rogue.oti.com...
> That's correct. In order to paint handles, connections, and feedback, it
> wasn't possible to support the use of heavyweight objects like an SWT
> control. Everything is a figure on a Canvas. The EditPart has access to
> this canvas, so if you wanted to place a "proxy" figure in the diagram,
and
> synchronize it with a SashForm that is parented by that cavnas, you might
be
> able to get that to work.
>
> "Rich Naylor" <rich.naylor@active-endpoints.com> wrote in message
> news:b4nrl3$2mq$1@rogue.oti.com...
> > I'm trying to create an EditPart which will display it's contents in a
> > "split pane" style, such as the org.eclipse.swt.custom.SashForm class
> does.
> > Looking through the docs for
> > org.eclipse.gef.editparts.AbstractGraphicalEditPart, an EditPart needs
to
> > create a visual component which implements the
org.eclipse.draw2d.IFigure
> > interface. There seems to be no relation between an IFigure component
and
> a
> > SWT component. I'm wondering if I'm missing something or if what I'm
> trying
> > to do can be done. I appreciate any thoughts or comments on this.
Thanks
> in
> > advance.
> >
> > - Rich
> >
> >
>
>
Re: GEF EditParts and SWT [message #69695 is a reply to message #69676] Wed, 12 March 2003 20:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Rich Naylor" <rich.naylor@active-endpoints.com> wrote in message
news:b4o0t2$71r$1@rogue.oti.com...
> If I did create a proxy figure linked to a SashForm, would I still be
able
> to
> allow the user the ability to modify the SashForm. I would need to be able
> to
> add/delete child panes and change the size of the panes within the figure.

No magic there. It would just be an SWT SashForm. You could embed
GraphicalViewer's in the left and right sides, but I don't know if that
helps any.

>
> Are there any other known limitations of using this technique, or other
> alternative approaches which may work better within the eclipse
> architecture?

Within the GEF architiecture, you could very easily make something that
looks and feels like a Sashform, but is just a compound figure. Also, it
could be keyboard accessible, unlike Sashform.

> Thanks for your feedback.
>
> - Rich
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:b4nu2c$4sv$1@rogue.oti.com...
> > That's correct. In order to paint handles, connections, and feedback,
it
> > wasn't possible to support the use of heavyweight objects like an SWT
> > control. Everything is a figure on a Canvas. The EditPart has access
to
> > this canvas, so if you wanted to place a "proxy" figure in the diagram,
> and
> > synchronize it with a SashForm that is parented by that cavnas, you
might
> be
> > able to get that to work.
> >
> > "Rich Naylor" <rich.naylor@active-endpoints.com> wrote in message
> > news:b4nrl3$2mq$1@rogue.oti.com...
> > > I'm trying to create an EditPart which will display it's contents in a
> > > "split pane" style, such as the org.eclipse.swt.custom.SashForm class
> > does.
> > > Looking through the docs for
> > > org.eclipse.gef.editparts.AbstractGraphicalEditPart, an EditPart needs
> to
> > > create a visual component which implements the
> org.eclipse.draw2d.IFigure
> > > interface. There seems to be no relation between an IFigure component
> and
> > a
> > > SWT component. I'm wondering if I'm missing something or if what I'm
> > trying
> > > to do can be done. I appreciate any thoughts or comments on this.
> Thanks
> > in
> > > advance.
> > >
> > > - Rich
> > >
> > >
> >
> >
>
>
Re: GEF EditParts and SWT [message #69934 is a reply to message #69695] Thu, 13 March 2003 14:31 Go to previous messageGo to next message
Rich Naylor is currently offline Rich NaylorFriend
Messages: 4
Registered: July 2009
Junior Member
Randy -

Thanks for your suggestions on this. I think I'm going to opt for the latter
approach, and stay within the GEF framework. It just seems cleaner that
way instead of trying to blend in the SWT components through a proxy.

- Rich

"Randy Hudson" <none@us.ibm.com> wrote in message
news:b4o69a$bbv$1@rogue.oti.com...
> "Rich Naylor" <rich.naylor@active-endpoints.com> wrote in message
> news:b4o0t2$71r$1@rogue.oti.com...
> > If I did create a proxy figure linked to a SashForm, would I still be
> able
> > to
> > allow the user the ability to modify the SashForm. I would need to be
able
> > to
> > add/delete child panes and change the size of the panes within the
figure.
>
> No magic there. It would just be an SWT SashForm. You could embed
> GraphicalViewer's in the left and right sides, but I don't know if that
> helps any.
>
> >
> > Are there any other known limitations of using this technique, or other
> > alternative approaches which may work better within the eclipse
> > architecture?
>
> Within the GEF architiecture, you could very easily make something that
> looks and feels like a Sashform, but is just a compound figure. Also, it
> could be keyboard accessible, unlike Sashform.
>
> > Thanks for your feedback.
> >
> > - Rich
> >
> > "Randy Hudson" <none@us.ibm.com> wrote in message
> > news:b4nu2c$4sv$1@rogue.oti.com...
> > > That's correct. In order to paint handles, connections, and feedback,
> it
> > > wasn't possible to support the use of heavyweight objects like an SWT
> > > control. Everything is a figure on a Canvas. The EditPart has access
> to
> > > this canvas, so if you wanted to place a "proxy" figure in the
diagram,
> > and
> > > synchronize it with a SashForm that is parented by that cavnas, you
> might
> > be
> > > able to get that to work.
> > >
> > > "Rich Naylor" <rich.naylor@active-endpoints.com> wrote in message
> > > news:b4nrl3$2mq$1@rogue.oti.com...
> > > > I'm trying to create an EditPart which will display it's contents in
a
> > > > "split pane" style, such as the org.eclipse.swt.custom.SashForm
class
> > > does.
> > > > Looking through the docs for
> > > > org.eclipse.gef.editparts.AbstractGraphicalEditPart, an EditPart
needs
> > to
> > > > create a visual component which implements the
> > org.eclipse.draw2d.IFigure
> > > > interface. There seems to be no relation between an IFigure
component
> > and
> > > a
> > > > SWT component. I'm wondering if I'm missing something or if what I'm
> > > trying
> > > > to do can be done. I appreciate any thoughts or comments on this.
> > Thanks
> > > in
> > > > advance.
> > > >
> > > > - Rich
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: GEF EditParts and SWT [message #70034 is a reply to message #69934] Thu, 13 March 2003 15:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Good luck. Maybe you'd like to contribute your results to the community?
There are ways to do this that might allow it to be reused. If you build
this into an EditPart, it won't be reusable because people usually have
their own entire hierarchy of editpart classes. But, if you make it
figure-based, with an additional SelectionHandleEditPolicy that implements
the sash as a GEF handle, it could be reused in just about any EditPart.
Also, handles are keyboard accessible in GEF (use the period key to navigate
handles). Currently a handle has to be on the handle layer, but we have a
bug open requesting that handles be anywhere.


"Rich Naylor" <rich.naylor@active-endpoints.com> wrote in message
news:b4q4q1$lhm$1@rogue.oti.com...
> Randy -
>
> Thanks for your suggestions on this. I think I'm going to opt for the
latter
> approach, and stay within the GEF framework. It just seems cleaner that
> way instead of trying to blend in the SWT components through a proxy.
>
> - Rich
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:b4o69a$bbv$1@rogue.oti.com...
> > "Rich Naylor" <rich.naylor@active-endpoints.com> wrote in message
> > news:b4o0t2$71r$1@rogue.oti.com...
> > > If I did create a proxy figure linked to a SashForm, would I still be
> > able
> > > to
> > > allow the user the ability to modify the SashForm. I would need to be
> able
> > > to
> > > add/delete child panes and change the size of the panes within the
> figure.
> >
> > No magic there. It would just be an SWT SashForm. You could embed
> > GraphicalViewer's in the left and right sides, but I don't know if that
> > helps any.
> >
> > >
> > > Are there any other known limitations of using this technique, or
other
> > > alternative approaches which may work better within the eclipse
> > > architecture?
> >
> > Within the GEF architiecture, you could very easily make something that
> > looks and feels like a Sashform, but is just a compound figure. Also,
it
> > could be keyboard accessible, unlike Sashform.
> >
> > > Thanks for your feedback.
> > >
> > > - Rich
> > >
> > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > news:b4nu2c$4sv$1@rogue.oti.com...
> > > > That's correct. In order to paint handles, connections, and
feedback,
> > it
> > > > wasn't possible to support the use of heavyweight objects like an
SWT
> > > > control. Everything is a figure on a Canvas. The EditPart has
access
> > to
> > > > this canvas, so if you wanted to place a "proxy" figure in the
> diagram,
> > > and
> > > > synchronize it with a SashForm that is parented by that cavnas, you
> > might
> > > be
> > > > able to get that to work.
> > > >
> > > > "Rich Naylor" <rich.naylor@active-endpoints.com> wrote in message
> > > > news:b4nrl3$2mq$1@rogue.oti.com...
> > > > > I'm trying to create an EditPart which will display it's contents
in
> a
> > > > > "split pane" style, such as the org.eclipse.swt.custom.SashForm
> class
> > > > does.
> > > > > Looking through the docs for
> > > > > org.eclipse.gef.editparts.AbstractGraphicalEditPart, an EditPart
> needs
> > > to
> > > > > create a visual component which implements the
> > > org.eclipse.draw2d.IFigure
> > > > > interface. There seems to be no relation between an IFigure
> component
> > > and
> > > > a
> > > > > SWT component. I'm wondering if I'm missing something or if what
I'm
> > > > trying
> > > > > to do can be done. I appreciate any thoughts or comments on this.
> > > Thanks
> > > > in
> > > > > advance.
> > > > >
> > > > > - Rich
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: GEF EditParts and SWT [message #70093 is a reply to message #70034] Thu, 13 March 2003 18:34 Go to previous messageGo to next message
Rich Naylor is currently offline Rich NaylorFriend
Messages: 4
Registered: July 2009
Junior Member
Sure, if I come up with something generic I'd be happy to pass it on.

I'm looking into making it figure based, but the docs and developer
guides are pretty sparse in the Draw2d area. Are there any good
examples of something similar already in use that you're aware of?

- Rich

"Randy Hudson" <none@us.ibm.com> wrote in message
news:b4q8k9$pa8$1@rogue.oti.com...
> Good luck. Maybe you'd like to contribute your results to the community?
> There are ways to do this that might allow it to be reused. If you build
> this into an EditPart, it won't be reusable because people usually have
> their own entire hierarchy of editpart classes. But, if you make it
> figure-based, with an additional SelectionHandleEditPolicy that implements
> the sash as a GEF handle, it could be reused in just about any EditPart.
> Also, handles are keyboard accessible in GEF (use the period key to
navigate
> handles). Currently a handle has to be on the handle layer, but we have a
> bug open requesting that handles be anywhere.
>
>
> "Rich Naylor" <rich.naylor@active-endpoints.com> wrote in message
> news:b4q4q1$lhm$1@rogue.oti.com...
> > Randy -
> >
> > Thanks for your suggestions on this. I think I'm going to opt for the
> latter
> > approach, and stay within the GEF framework. It just seems cleaner that
> > way instead of trying to blend in the SWT components through a proxy.
> >
> > - Rich
> >
> > "Randy Hudson" <none@us.ibm.com> wrote in message
> > news:b4o69a$bbv$1@rogue.oti.com...
> > > "Rich Naylor" <rich.naylor@active-endpoints.com> wrote in message
> > > news:b4o0t2$71r$1@rogue.oti.com...
> > > > If I did create a proxy figure linked to a SashForm, would I still
be
> > > able
> > > > to
> > > > allow the user the ability to modify the SashForm. I would need to
be
> > able
> > > > to
> > > > add/delete child panes and change the size of the panes within the
> > figure.
> > >
> > > No magic there. It would just be an SWT SashForm. You could embed
> > > GraphicalViewer's in the left and right sides, but I don't know if
that
> > > helps any.
> > >
> > > >
> > > > Are there any other known limitations of using this technique, or
> other
> > > > alternative approaches which may work better within the eclipse
> > > > architecture?
> > >
> > > Within the GEF architiecture, you could very easily make something
that
> > > looks and feels like a Sashform, but is just a compound figure. Also,
> it
> > > could be keyboard accessible, unlike Sashform.
> > >
> > > > Thanks for your feedback.
> > > >
> > > > - Rich
> > > >
> > > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > > news:b4nu2c$4sv$1@rogue.oti.com...
> > > > > That's correct. In order to paint handles, connections, and
> feedback,
> > > it
> > > > > wasn't possible to support the use of heavyweight objects like an
> SWT
> > > > > control. Everything is a figure on a Canvas. The EditPart has
> access
> > > to
> > > > > this canvas, so if you wanted to place a "proxy" figure in the
> > diagram,
> > > > and
> > > > > synchronize it with a SashForm that is parented by that cavnas,
you
> > > might
> > > > be
> > > > > able to get that to work.
> > > > >
> > > > > "Rich Naylor" <rich.naylor@active-endpoints.com> wrote in message
> > > > > news:b4nrl3$2mq$1@rogue.oti.com...
> > > > > > I'm trying to create an EditPart which will display it's
contents
> in
> > a
> > > > > > "split pane" style, such as the org.eclipse.swt.custom.SashForm
> > class
> > > > > does.
> > > > > > Looking through the docs for
> > > > > > org.eclipse.gef.editparts.AbstractGraphicalEditPart, an EditPart
> > needs
> > > > to
> > > > > > create a visual component which implements the
> > > > org.eclipse.draw2d.IFigure
> > > > > > interface. There seems to be no relation between an IFigure
> > component
> > > > and
> > > > > a
> > > > > > SWT component. I'm wondering if I'm missing something or if what
> I'm
> > > > > trying
> > > > > > to do can be done. I appreciate any thoughts or comments on
this.
> > > > Thanks
> > > > > in
> > > > > > advance.
> > > > > >
> > > > > > - Rich
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: GEF EditParts and SWT [message #70130 is a reply to message #70093] Thu, 13 March 2003 18:48 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Rich Naylor" <rich.naylor@active-endpoints.com> wrote in message
news:b4qj1o$33u$1@rogue.oti.com...
> Sure, if I come up with something generic I'd be happy to pass it on.
>
> I'm looking into making it figure based, but the docs and developer
> guides are pretty sparse in the Draw2d area. Are there any good
> examples of something similar already in use that you're aware of?

There isn't too much "widgety" stuff in draw2d now. The draw2d part could
be non-interactive, and just consist of a layout manager that left and right
children different portions of the available space (client area). Then, the
GEF handle would be the interactive part to redistribute the space, probably
by setting a property on the layout, and causing a re-layout.

>
> - Rich
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:b4q8k9$pa8$1@rogue.oti.com...
> > Good luck. Maybe you'd like to contribute your results to the
community?
> > There are ways to do this that might allow it to be reused. If you
build
> > this into an EditPart, it won't be reusable because people usually have
> > their own entire hierarchy of editpart classes. But, if you make it
> > figure-based, with an additional SelectionHandleEditPolicy that
implements
> > the sash as a GEF handle, it could be reused in just about any EditPart.
> > Also, handles are keyboard accessible in GEF (use the period key to
> navigate
> > handles). Currently a handle has to be on the handle layer, but we have
a
> > bug open requesting that handles be anywhere.
> >
> >
> > "Rich Naylor" <rich.naylor@active-endpoints.com> wrote in message
> > news:b4q4q1$lhm$1@rogue.oti.com...
> > > Randy -
> > >
> > > Thanks for your suggestions on this. I think I'm going to opt for the
> > latter
> > > approach, and stay within the GEF framework. It just seems cleaner
that
> > > way instead of trying to blend in the SWT components through a proxy.
> > >
> > > - Rich
> > >
> > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > news:b4o69a$bbv$1@rogue.oti.com...
> > > > "Rich Naylor" <rich.naylor@active-endpoints.com> wrote in message
> > > > news:b4o0t2$71r$1@rogue.oti.com...
> > > > > If I did create a proxy figure linked to a SashForm, would I
still
> be
> > > > able
> > > > > to
> > > > > allow the user the ability to modify the SashForm. I would need to
> be
> > > able
> > > > > to
> > > > > add/delete child panes and change the size of the panes within the
> > > figure.
> > > >
> > > > No magic there. It would just be an SWT SashForm. You could embed
> > > > GraphicalViewer's in the left and right sides, but I don't know if
> that
> > > > helps any.
> > > >
> > > > >
> > > > > Are there any other known limitations of using this technique, or
> > other
> > > > > alternative approaches which may work better within the eclipse
> > > > > architecture?
> > > >
> > > > Within the GEF architiecture, you could very easily make something
> that
> > > > looks and feels like a Sashform, but is just a compound figure.
Also,
> > it
> > > > could be keyboard accessible, unlike Sashform.
> > > >
> > > > > Thanks for your feedback.
> > > > >
> > > > > - Rich
> > > > >
> > > > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > > > news:b4nu2c$4sv$1@rogue.oti.com...
> > > > > > That's correct. In order to paint handles, connections, and
> > feedback,
> > > > it
> > > > > > wasn't possible to support the use of heavyweight objects like
an
> > SWT
> > > > > > control. Everything is a figure on a Canvas. The EditPart has
> > access
> > > > to
> > > > > > this canvas, so if you wanted to place a "proxy" figure in the
> > > diagram,
> > > > > and
> > > > > > synchronize it with a SashForm that is parented by that cavnas,
> you
> > > > might
> > > > > be
> > > > > > able to get that to work.
> > > > > >
> > > > > > "Rich Naylor" <rich.naylor@active-endpoints.com> wrote in
message
> > > > > > news:b4nrl3$2mq$1@rogue.oti.com...
> > > > > > > I'm trying to create an EditPart which will display it's
> contents
> > in
> > > a
> > > > > > > "split pane" style, such as the
org.eclipse.swt.custom.SashForm
> > > class
> > > > > > does.
> > > > > > > Looking through the docs for
> > > > > > > org.eclipse.gef.editparts.AbstractGraphicalEditPart, an
EditPart
> > > needs
> > > > > to
> > > > > > > create a visual component which implements the
> > > > > org.eclipse.draw2d.IFigure
> > > > > > > interface. There seems to be no relation between an IFigure
> > > component
> > > > > and
> > > > > > a
> > > > > > > SWT component. I'm wondering if I'm missing something or if
what
> > I'm
> > > > > > trying
> > > > > > > to do can be done. I appreciate any thoughts or comments on
> this.
> > > > > Thanks
> > > > > > in
> > > > > > > advance.
> > > > > > >
> > > > > > > - Rich
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Previous Topic:Problems with the example HelloGef2
Next Topic:Having 2 types of connections
Goto Forum:
  


Current Time: Mon Jul 22 07:43:50 GMT 2024

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

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

Back to the top