[ 
https://issues.apache.org/jira/browse/PIVOT-181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12734227#action_12734227
 ] 

Todd Volkert commented on PIVOT-181:
------------------------------------

I think the bottom line is that the caller can have the best of all worlds here:

1) If they want to use the feature and have their context menus tied to the 
component hierarchy over which the mouse button was clicked (I believe this to 
be a very common use case), then they can.

2) If they want to not use the feature and roll their own context menu 
sub-system, they can (by not setting any context menu handlers on any 
components).

3) If they want to go one step further and prevent anyone else in the 
application from using this feature and colliding with their custom sub-system, 
they can do that too, by setting a context menu handler on the display that 
simply returns false.

> Context menu handler
> --------------------
>
>                 Key: PIVOT-181
>                 URL: https://issues.apache.org/jira/browse/PIVOT-181
>             Project: Pivot
>          Issue Type: New Feature
>          Components: wtk
>            Reporter: Todd Volkert
>            Assignee: Todd Volkert
>             Fix For: 1.3
>
>
> Create framework-level support for context menus by creating a 
> Component.ContextMenuHandler interface.  When the display host detects a 
> right click, it will:
> 1) Get a reference to the lowest-level component that the mouse is over, and 
> if that's non-null...
> 2) Construct the path from the display to that component, instantiate a 
> MenuPopup
> 3) Walk the path, passing the menu popup's menu to each ContextMenuHandler 
> that is found along the path
> 4) Open the menu popup if the menu is non-empty after the path has been walked

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to