Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Child menu action gets fired when its parent menu is clicked
Child menu action gets fired when its parent menu is clicked [message #66809] Sun, 16 December 2007 21:03 Go to next message
Eclipse UserFriend
Hi,

I have the following menu hierarchy in RAP :

File
|
Explorer
|
|- Show
|- Activate

Show & Activate menu is actually the child menu of Explorer and Explorer
is the child menu of File.
When I click Explorer menu to display Show & Activate menu the Show menu's
action always get fired as if the Show menu is clicked. This makes me
impossible to distinguish whether the events come from the Explorer or
Show menu itself.

Is this a known bug ?

Thanks and Regards,

Setya
Re: Child menu action gets fired when its parent menu is clicked [message #66936 is a reply to message #66809] Mon, 17 December 2007 09:51 Go to previous messageGo to next message
Eclipse UserFriend
Hi Setya,

just tried this case in a little example but didn't get it to work
(let's say i didn't get it to behave in the way you described). Could
you please attach a snippet so we can reproduce this behavior?
btw: If you feel you found a bug, just open a new bug report. If it
isn't a real bug we can still close it again.

Greets
Benny

Setya wrote:
> Hi,
>
> I have the following menu hierarchy in RAP :
>
> File
> |
> Explorer
> |
> |- Show
> |- Activate
>
> Show & Activate menu is actually the child menu of Explorer and Explorer
> is the child menu of File.
> When I click Explorer menu to display Show & Activate menu the Show
> menu's action always get fired as if the Show menu is clicked. This
> makes me impossible to distinguish whether the events come from the
> Explorer or Show menu itself.
> Is this a known bug ?
>
> Thanks and Regards,
>
> Setya
>
Re: Child menu action gets fired when its parent menu is clicked [message #66962 is a reply to message #66936] Tue, 18 December 2007 00:20 Go to previous message
Eclipse UserFriend
Benny,

I have solved the problem.
The problem is triggered by the fact that I reuse the same Explorer action
for both menu and toolbar.

In the Explorer action I put the following code :

public void run()
{
showAction.run();
}

With the above code I want to trigger the Show's action whenever Explorer
button in the toolbar is clicked, but I forgot to consider the fact that
the same action is also used for the menu.

So I replace the method with :

public void runWithEvent(Event event)
{
if (event.widget.getClass().equals(ToolItem.class))
{
showAction.run();
return;
}

super.runWithEvent(event);
}

And the problem is solved.

Sorry for all the trouble and thank you for your time to investigate.

Best Regards,

Setya
Previous Topic:browser widget
Next Topic:Resource management
Goto Forum:
  


Current Time: Fri Apr 25 03:56:55 EDT 2025

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

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

Back to the top