Enable Eclipse Project Explorer extension only when two elements are selected [message #1831081] |
Tue, 11 August 2020 06:58  |
Eclipse User |
|
|
|
I am currently trying to create an Eclipse RCP application, in which I would like to extend the Project Explorer. The goal is to add a "button" when I right click on an element in the Project Explorer. I have added the button using the
org.eclipse.ui.navigator.viewer and org.eclipse.ui.navigator.navigatorContent extensions in the defining plugin of my application.
The MANIFEST.MF of the defining plugin looks like this (this shows only the part that is interesting of course) :
<extension point="org.eclipse.ui.navigator.viewer">
<viewerActionBinding
viewerId="org.eclipse.ui.navigator.ProjectExplorer">
<includes>
<actionExtension
pattern="generate">
</actionExtension>
</includes>
</viewerActionBinding>
</extension>
<extension point="org.eclipse.ui.navigator.navigatorContent">
<actionProvider
class="package.GenerateActionProvider"
id="generate">
<enablement>
<adapt
type="org.eclipse.core.resources.IResource">
<test
property="org.eclipse.core.resources.name"
value="*.ecore">
</test>
</adapt>
</enablement>
</actionProvider>
</extension>
With this, I have the "button" I want when I right click on .ecore files. What I want is to make this "button" enabled only when two files are selected before the right click. I have tried using the count parameter but I do not know how it works and I have not found any examples to help me out.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03396 seconds