[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.gef] Re: ContextMenuProvider + selected editParts
|
JFace already provides a filter mechanism. You need to provide the filter
processor, and fill in the rules for your actions in the plugin.xml file.
The only reason to use this mechanism would be to prevent plug-in startup.
Otherwise, I'd just use the enablement technique we use in the examples.
"James Willans" <james.willans@xxxxxxxxxxx> wrote in message
news:cn2r7o$dpv$1@xxxxxxxxxxxxxx
> 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
> >>
>
>