Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 10:58 Go to next message
Jean Walter is currently offline Jean WalterFriend
Messages: 10
Registered: May 2020
Junior Member
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 17:50 Go to previous message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 179
Registered: April 2012
Senior Member
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: Fri Oct 30 05:47:33 GMT 2020

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

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

Back to the top