Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to create a "right click popup menu" for my RAP application?
How to create a "right click popup menu" for my RAP application? [message #645209] Wed, 15 December 2010 23:05 Go to next message
No real name is currently offline No real nameFriend
Messages: 8
Registered: December 2010
Junior Member
Hi,

i just wanted to ask, if it is possible to create a popup menu for a button (SWT.RADIO), that opens after clicking with a rightclick on it.

Thanks for your answers! Smile
Re: How to create a "right click popup menu" for my RAP application? [message #645240 is a reply to message #645209] Thu, 16 December 2010 08:10 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 1872
Registered: July 2009
Senior Member
Hi,
look at "SWT Snippets" [1] for examples how tho create a pop-up menu. In
short:
1. Create menu with SWT.POPUP style flag like:
Menu menu = new Menu (shell, SWT.POP_UP);
2. Set it to control:
button.setMenu( menu );

[1] http://www.eclipse.org/swt/snippets/
HTH,
Ivan

On 16.12.2010 1:05 AM, neumuellerch@gmail.com wrote:
> Hi,
>
> i just wanted to ask, if it is possible to create a popup menu for a
> button (SWT.RADIO), that opens after clicking with a rightclick on it.
>
> Thanks for your answers! :)
Re: How to create a "right click popup menu" for my RAP application? [message #645372 is a reply to message #645240] Thu, 16 December 2010 18:56 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 8
Registered: December 2010
Junior Member
Ivan Furnadjiev wrote on Thu, 16 December 2010 03:10
Hi,
look at "SWT Snippets" [1] for examples how tho create a pop-up menu. In
short:
1. Create menu with SWT.POPUP style flag like:
Menu menu = new Menu (shell, SWT.POP_UP);
2. Set it to control:
button.setMenu( menu );
(....)
>
> Thanks for your answers! Smile



The popup is not directly my problem. I need a listener (e.g mouse listener) for opening this menu on a "right-click" event.

But thankyou for the quick answer.
Re: How to create a "right click popup menu" for my RAP application? [message #645380 is a reply to message #645372] Thu, 16 December 2010 20:08 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 1872
Registered: July 2009
Senior Member
Hi,
MenuDetectListener is what you need.
HTH,
Ivan

On 16.12.2010 8:56 PM, neumuellerch@gmail.com wrote:
> Ivan Furnadjiev wrote on Thu, 16 December 2010 03:10
>> Hi,
>> look at "SWT Snippets" [1] for examples how tho create a pop-up menu.
>> In short:
>> 1. Create menu with SWT.POPUP style flag like:
>> Menu menu = new Menu (shell, SWT.POP_UP);
>> 2. Set it to control:
>> button.setMenu( menu );
>> (....)
>> >
>> > Thanks for your answers! :)
>
>
>
> The popup is not directly my problem. I need a listener (e.g mouse
> listener) for opening this menu on a "right-click" event.
>
> But thankyou for the quick answer.
Re: How to create a "right click popup menu" for my RAP application? [message #645536 is a reply to message #645380] Fri, 17 December 2010 17:23 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 8
Registered: December 2010
Junior Member
Ivan Furnadjiev wrote on Thu, 16 December 2010 15:08
Hi,
MenuDetectListener is what you need.
HTH,
Ivan
.



Thankyou - again.

But is there a possiblity to add it to ToolItem ( http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/api/org/eclipse/swt/widgets/ToolI tem.html) There is just the addSelctionListener etc, but no MenuDetectListener?
Re: How to create a "right click popup menu" for my RAP application? [message #645619 is a reply to message #645536] Sat, 18 December 2010 21:34 Go to previous message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1296
Registered: July 2009
Senior Member

Hi,

I'd suggest you have a look at the SWT Snippets:
http://www.eclipse.org/swt/snippets/

There are a lot of examples on how menus can be used.

Regards, Ralf

--
Ralf Sternberg

Twitter: http://twitter.com/ralfstx
Blog: http://www.eclipsesource.com/blogs/

Professional support for RAP and RCP?
http://www.eclipsesource.com/support/
Previous Topic:White page after redirection
Next Topic:[ANN] RAP 1.4 M4 is available
Goto Forum:
  


Current Time: Fri Dec 19 15:53:04 GMT 2014

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

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