Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Using SWT controls as Figure?
Using SWT controls as Figure? [message #47342] Wed, 04 December 2002 16:04 Go to next message
Hal is currently offline HalFriend
Messages: 67
Registered: July 2009
Member
Hi,

In GEF, is it possible to use SWT controls (e.g. a Tree or a Table) as the
Figure (View of the MVC) in the GEF?
I check the code, SWT controls are not inherit from IFigure. So do I need
to write some kind of adapter or it is not possible by design?

Thank you.
Re: Using SWT controls as Figure? [message #47464 is a reply to message #47342] Wed, 04 December 2002 18:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

You could write a proxy figure that positions an SWT control to match its
bounds.

There will be some issues:
1) Cannot paint on top of another SWT control, so no handles, feedback,
connections, etc.
2) Focus problems. You would probably have to set the SWT control to be not
active, so it doesn't steal mouse events.
3) targeting problems. GraphicalViewer is not designed to target EditParts
inside multiple controls
4) Print. You can't print a native Tree/Table

"Hal" <otaconss2@hotmail.com> wrote in message
news:asl8sk$dln$1@rogue.oti.com...
> Hi,
>
> In GEF, is it possible to use SWT controls (e.g. a Tree or a Table) as the
> Figure (View of the MVC) in the GEF?
> I check the code, SWT controls are not inherit from IFigure. So do I need
> to write some kind of adapter or it is not possible by design?
>
> Thank you.
>
>
>
Re: Using SWT controls as Figure? [message #47494 is a reply to message #47464] Thu, 05 December 2002 08:32 Go to previous messageGo to next message
Alexandre Vermeerbergen is currently offline Alexandre VermeerbergenFriend
Messages: 110
Registered: July 2009
Senior Member
"Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
news:aslggl$j4s$1@rogue.oti.com...
> You could write a proxy figure that positions an SWT control to match its
> bounds.
>
> There will be some issues:
> 1) Cannot paint on top of another SWT control, so no handles, feedback,
> connections, etc.
> 2) Focus problems. You would probably have to set the SWT control to be
not
> active, so it doesn't steal mouse events.

But what if he needs to have a SWT widget to edit some data? something like
a textfield or table cell editor?
The SWT widget should have its mouse & keyboard events redirected...

Yet I understand that draw2d and SWT have radically different
implementations: draw2d is based on painting pixels on a canvas, so all
pre-defined figures and even pseudo-widget like ScrollPane or Label are
emulated like in Java Swing ; whereas SWT is a thin Java wrapping of native
(Mac, Motif, Windows, etc.) widgets and that involves constraints like no
overlapping widgets.

But since I can read in this newsgroup that I am not the first to need
emulated SWT widgets in draw2d, shouldn't we consider as a possible
GEF/draw2d evolution request to implement draw2d equivalent for: List, Tree,
Textfield (maybe we have something like that with label, from what I see in
Logical Diagram Editor), combo, table/tree editor, etc. with a decent focus
& selection management (I have somehow hard time to manage
selection/deselection of items is several emulated draw2d lists....
currently ;-)

Any vote here?
Re: Using SWT controls as Figure? [message #47796 is a reply to message #47494] Thu, 05 December 2002 17:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

>
> "Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
> news:aslggl$j4s$1@rogue.oti.com...
> > You could write a proxy figure that positions an SWT control to match
its
> > bounds.
> >
> > There will be some issues:
> > 1) Cannot paint on top of another SWT control, so no handles, feedback,
> > connections, etc.
> > 2) Focus problems. You would probably have to set the SWT control to be
> not
> > active, so it doesn't steal mouse events.
>
> But what if he needs to have a SWT widget to edit some data? something
like
> a textfield or table cell editor?

CellEditors are supported. Have you double-clicked on a Logic Label?

> The SWT widget should have its mouse & keyboard events redirected...
>
> Yet I understand that draw2d and SWT have radically different
> implementations: draw2d is based on painting pixels on a canvas, so all
> pre-defined figures and even pseudo-widget like ScrollPane or Label are
> emulated like in Java Swing ; whereas SWT is a thin Java wrapping of
native
> (Mac, Motif, Windows, etc.) widgets and that involves constraints like no
> overlapping widgets.
>
> But since I can read in this newsgroup that I am not the first to need
> emulated SWT widgets in draw2d, shouldn't we consider as a possible
> GEF/draw2d evolution request to implement draw2d equivalent for: List,
Tree,
> Textfield (maybe we have something like that with label, from what I see
in
> Logical Diagram Editor), combo, table/tree editor, etc. with a decent
focus
> & selection management (I have somehow hard time to manage
> selection/deselection of items is several emulated draw2d lists....
> currently ;-)
> Any vote here?
>
>
>
>
>
Re: Using SWT controls as Figure? [message #48248 is a reply to message #47796] Fri, 06 December 2002 11:38 Go to previous message
Alexandre Vermeerbergen is currently offline Alexandre VermeerbergenFriend
Messages: 110
Registered: July 2009
Senior Member
"Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
news:aso1b1$ne$1@rogue.oti.com...
> CellEditors are supported. Have you double-clicked on a Logic Label?

Is that something that works only in GEF "2", or is it possible to do it
with the GEF "1" that comes with WebSphere Workbench 1.0?

I am still living in the deployed world of WSAD 4.x :(
Hopefully I found that GEF 1 can be installed in Eclipse 2.1 M3 so that
development with latest 2.1 gadgets (I like very much hyperlinking of Java
code) is possible!
Previous Topic:Problems with Help
Next Topic:quick start on implementing own layout
Goto Forum:
  


Current Time: Mon Dec 30 16:35:35 GMT 2024

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

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

Back to the top