Skip to main content



      Home
Home » Eclipse Projects » GEF » Draw2D menu?
Draw2D menu? [message #3484] Tue, 21 May 2002 17:45 Go to next message
Eclipse UserFriend
Originally posted by: craig.setera.kingland.com

Is there a pre-built popup menu figure in Draw2D or GEF? I see a
PopupHelper class, but I'm not sure what to do with it.

Thanks,
Craig
Re: Draw2D menu? [message #3517 is a reply to message #3484] Tue, 21 May 2002 17:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.ibm.com

There is no Popup menu support in draw2d.
Are you trying to popup a figure instead of a native menu? You probably
could use/subclass PopupHelper for this purpose.

But, if there is a ContextMenu set on the Canvas, it will steal the mouse
events. Also, I'm not sure how to simulate the different popup behaviors on
the various platforms (button pressed versus released).

"Craig Setera" <craig.setera@kingland.com> wrote in message
news:aceeek$h2t$1@rogue.oti.com...
> Is there a pre-built popup menu figure in Draw2D or GEF? I see a
> PopupHelper class, but I'm not sure what to do with it.
>
> Thanks,
> Craig
>
>
Re: Draw2D menu? [message #3579 is a reply to message #3517] Tue, 21 May 2002 21:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: craig.setera.kingland.com

I guess what I'm looking to do is to be able to get a popup menu on a
RectangleFigure. Is this at all possible with the current code... short of
writing a menuing support myself. I'd like to be able to create some menu
items like "hide" to be able to control the figure.

"Randy Hudson" <none@ibm.com> wrote in message
news:aceen4$h6n$1@rogue.oti.com...
> There is no Popup menu support in draw2d.
> Are you trying to popup a figure instead of a native menu? You probably
> could use/subclass PopupHelper for this purpose.
>
> But, if there is a ContextMenu set on the Canvas, it will steal the mouse
> events. Also, I'm not sure how to simulate the different popup behaviors
on
> the various platforms (button pressed versus released).
>



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
Re: Draw2D menu? [message #3612 is a reply to message #3579] Wed, 22 May 2002 09:08 Go to previous messageGo to next message
Eclipse UserFriend
You can define a context menu provider to your viewer
(AbstractEditPartViewer.setContextMenuProvider). In my case, my context menu
provider builds a menu ( when asked ) using actions I have added to the
ActionRegistery of my editor. The Actions know what edit parts are selected
when the context menu was invoked because they sub class something that
implements ISelectionListener and is registered with the editor as a
selection listener. Knowing what is currently selected means thay can decide
whether or not they are active. The context menu provider can then decide
whether to included them in the menu.

Guy
Re: Draw2D menu? [message #3645 is a reply to message #3579] Wed, 22 May 2002 09:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.ibm.com

Guy Slade is correct, you can configure an EditPartViewer with a
ContextMenuProvider in GEF.

If you are trying to build a graphical application using only draw2d and not
GEF, you won't find much sympathy here. Why do you need a popup menu on a
Rectangle Figure?

"Craig Setera" <craig.setera@kingland.com> wrote in message
news:acer2a$ke6$1@rogue.oti.com...
> I guess what I'm looking to do is to be able to get a popup menu on a
> RectangleFigure. Is this at all possible with the current code... short
of
> writing a menuing support myself. I'd like to be able to create some menu
> items like "hide" to be able to control the figure.
>
> "Randy Hudson" <none@ibm.com> wrote in message
> news:aceen4$h6n$1@rogue.oti.com...
> > There is no Popup menu support in draw2d.
> > Are you trying to popup a figure instead of a native menu? You probably
> > could use/subclass PopupHelper for this purpose.
> >
> > But, if there is a ContextMenu set on the Canvas, it will steal the
mouse
> > events. Also, I'm not sure how to simulate the different popup
behaviors
> on
> > the various platforms (button pressed versus released).
> >
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
>
>
Re: Draw2D menu? [message #3708 is a reply to message #3645] Wed, 22 May 2002 10:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: craig.setera.kingland.com

Randy and Guy,

Not looking for sympathy by any means! <grin> Just trying to figure this
stuff out. You've already admitted that the documentation is not quite up
to snuff. I started with Draw2D because it is more intuitive to use. I
started looking a bit yesterday at GEF to try to understand it. I don't
have a big time business need for any of this, so it is a side project...
I'm just interested in understanding what is there and how to use it.

I will try to spend some more time with GEF to figure it out. It certainly
looks cool... Just need to figure out how to use it.

Thanks,
Craig

"Randy Hudson" <none@ibm.com> wrote in message
news:acg683$628$1@rogue.oti.com...
> Guy Slade is correct, you can configure an EditPartViewer with a
> ContextMenuProvider in GEF.
>
> If you are trying to build a graphical application using only draw2d and
not
> GEF, you won't find much sympathy here. Why do you need a popup menu on a
> Rectangle Figure?
>
Re: Draw2D menu? [message #3889 is a reply to message #3645] Wed, 22 May 2002 10:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dominic.nospam.com

Iam not sure i understand the subtle remark here ;-) but lemme say this. I
think a popup on a figure is a valid use case. Whether done through GEF or
draw2d i would not care but i would hope i am able to do this. I am thinking
of using GEF in a sequence diagram and it makes sense to show different
methods/events popup menu on a per object basis.



"Randy Hudson" <none@ibm.com> wrote in message
news:acg683$628$1@rogue.oti.com...
> Guy Slade is correct, you can configure an EditPartViewer with a
> ContextMenuProvider in GEF.
>
> If you are trying to build a graphical application using only draw2d and
not
> GEF, you won't find much sympathy here. Why do you need a popup menu on a
> Rectangle Figure?
>
> "Craig Setera" <craig.setera@kingland.com> wrote in message
> news:acer2a$ke6$1@rogue.oti.com...
> > I guess what I'm looking to do is to be able to get a popup menu on a
> > RectangleFigure. Is this at all possible with the current code... short
> of
> > writing a menuing support myself. I'd like to be able to create some
menu
> > items like "hide" to be able to control the figure.
> >
> > "Randy Hudson" <none@ibm.com> wrote in message
> > news:aceen4$h6n$1@rogue.oti.com...
> > > There is no Popup menu support in draw2d.
> > > Are you trying to popup a figure instead of a native menu? You
probably
> > > could use/subclass PopupHelper for this purpose.
> > >
> > > But, if there is a ContextMenu set on the Canvas, it will steal the
> mouse
> > > events. Also, I'm not sure how to simulate the different popup
> behaviors
> > on
> > > the various platforms (button pressed versus released).
> > >
> >
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
> >
> >
>
>
Re: Draw2D menu? [message #3894 is a reply to message #3889] Wed, 22 May 2002 11:48 Go to previous message
Eclipse UserFriend
Originally posted by: none.ibm.com

In GEF, a draw2d figure is used to render an EditPart. A
ContextMenuProvider can be set on the EditPartViewer, which contains the
EditParts being rendered as RectangleFigures or whatever. That viewer also
know the Parts which are selected. Remember that the context menu can be
invoked using Shift+F10.

So, your applications CMP can provide Menu actions specific to the
"figure(s)" or Part(s) that are selected. Even better, you can put things
on the context menu that aren't relevent to the shape, like Undo and Save.
Basically, you build the menu yourself based on the part or parts selected.

Hope this helps.

P.S. - My point about draw2d is that we have not implemented Swing on SWT,
so you cannot have a context menu associated with a Figure in the same way
that you have Control.setMenu(Menu)..\\

"dominic" <dominic@nospam.com> wrote in message
news:acgaq4$9mj$1@rogue.oti.com...
> Iam not sure i understand the subtle remark here ;-) but lemme say this. I
> think a popup on a figure is a valid use case. Whether done through GEF or
> draw2d i would not care but i would hope i am able to do this. I am
thinking
> of using GEF in a sequence diagram and it makes sense to show different
> methods/events popup menu on a per object basis.
>
>
Previous Topic:is planning to use GEF "safe" ?
Next Topic:The current download of GEF is not ready for distribution
Goto Forum:
  


Current Time: Fri Apr 25 19:18:41 EDT 2025

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

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

Back to the top