Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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] Mon, 17 December 2007 02:03 Go to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
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 14:51 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 237
Registered: July 2009
Senior Member
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 05:20 Go to previous message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
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: Wed Jul 17 03:28:59 GMT 2024

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

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

Back to the top