[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: ContextMenuProvider + selected editParts

Ok, I understand what you want to do. But I think the right way to do it is through the action enabled/disabled route. If you don't want disabled actions to show in your context menu then when your context menu provider builds the menu prior to showing it should only add the actions that are enabled.

Guy

James Willans wrote:
Guy,

Yes - I'm currently using that route, I was just wondering whether the list of selected edit parts was scoped over the ContextMenuProvider.

Thanks anyway.

James

Guy Slade wrote:

What about selectionAction.getSelectedObjects(). This gives you a list of the selected edit parts. The calculateEnabled() method of your action(s) can use this to decide if they are enabled or not.


Guy


James Willans wrote:


Is it possible to know which editparts are selected in a ContextMenuProvider? I want to be able to calculate which menus to show based on this knowledge. Note that there is not enough information in the SelectionAction since I need the set of (enabled) actions and the set of selected edit parts.

Thanks.

James