Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to enable a command for popups if the children of the selected element have an certain type
https://www.eclipse.org/forums/index.php/mv/msg/199550/636735/#msg_636735
Originally posted by: formatzeh.gmx.de
I declared a command and a handler for it. Now I want to enable the
command in popups. The point is that the command should be enabled when
right-clicking a folder (for example in the package explorer) and only
if the folder contains files of a certain type (for example a EMF
resource). Is it possible to declare this issue in the plugin.xml?
best regards,
Gilbert]]>2010-11-02T15:24:50-00:00Re: How to enable a command for popups if the children of the selected element have an certain type
https://www.eclipse.org/forums/index.php/mv/msg/199550/636871/#msg_636871
> I declared a command and a handler for it. Now I want to enable the
> command in popups. The point is that the command should be enabled when
> right-clicking a folder (for example in the package explorer) and only
> if the folder contains files of a certain type (for example a EMF
> resource). Is it possible to declare this issue in the plugin.xml?
>
> best regards,
> Gilbert
www.eclipse-tips.com]]>Prakash G.R.2010-11-03T08:18:27-00:00Re: How to enable a command for popups if the children of the selected element have an certain type
https://www.eclipse.org/forums/index.php/mv/msg/199550/636947/#msg_636947
Originally posted by: formatzeh.gmx.de
Hi Prakash,
thanks for the link. But what is described there is only how to
determine the explicit elements of the selection. That can be achieved
with that:
The point is that I want to check the children of the selected element.
Can this be achieved anyhow?
Prakash G.R. wrote:
> On 02/11/10 8:54 PM, Gilbert Mirenque wrote:
>> I declared a command and a handler for it. Now I want to enable the
>> command in popups. The point is that the command should be enabled when
>> right-clicking a folder (for example in the package explorer) and only
>> if the folder contains files of a certain type (for example a EMF
>> resource). Is it possible to declare this issue in the plugin.xml?
>>
>> best regards,
>> Gilbert
>
> Check this:
> http://www.eclipse-tips.com/tutorials/1-actions-vs-commands? start=1
>]]>2010-11-03T13:37:05-00:00Re: How to enable a command for popups if the children of the selected element have an certain type
https://www.eclipse.org/forums/index.php/mv/msg/199550/636973/#msg_636973
> But what I need in addition to that is something like the following:
>
> <enabledWhen>
> <with variable="children">
> <iterate operator="or">
> <instanceof
> value="org.eclipse.emf.ecore.resource.Resource"/>
> </iterate>
> </with>
> </enabledWhen>
>
> The point is that I want to check the children of the selected element.
> Can this be achieved anyhow?