Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Enable Eclipse Project Explorer extension only when two elements are selected(Enable Eclipse Project Explorer extension only when two elements are selected)
Enable Eclipse Project Explorer extension only when two elements are selected [message #1831081] Tue, 11 August 2020 06:58 Go to next message
Eclipse UserFriend
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.
Re: Enable Eclipse Project Explorer extension only when two elements are selected [message #1831096 is a reply to message #1831081] Tue, 11 August 2020 13:50 Go to previous message
Eclipse UserFriend
Have a look at this wiki entry:
https://wiki.eclipse.org/Platform_Expression_Framework#count
Previous Topic:Apple is moving to ARM processors
Next Topic:p2 repository update with log4j2x
Goto Forum:
  


Current Time: Tue May 13 01:00:41 EDT 2025

Powered by FUDForum. Page generated in 0.03396 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top