Results 1 to 3 of 3

Thread: extending the Spring Explorer view

  1. #1
    Join Date
    Apr 2008
    Posts
    2

    Question extending the Spring Explorer view

    I am in the process of writting an Eclipse plugin. I would like to add an additional popupmenu item to the Spring Explorer View. Currently when a user right-clicks on the xml file name within the Spring Explorer, they see my menu item.

    How can I change my plugin so that when the user right-clicks on a bean, they see my menu item?

    Currently the popup menu for beans includes:
    Open
    Open Java Element
    Open Graph
    Validate
    Properties

    Thanks,
    Sarah

  2. #2
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    Sarah,

    I think you're looking to the correct enablement to trigger your action. Here is the appropriate contribution from Spring IDE's plugin.xml

    Code:
    <extension
          point="org.eclipse.ui.navigator.navigatorContent">
          <actionProvider
              id="<your id>"
              class="<your action provider class">
    	         <enablement>
    				<or>
    					<and>
    						<instanceof value="org.eclipse.core.resources.IFile"/>
    						<test property="org.springframework.ide.eclipse.beans.core.model.isBeansConfig"/>
    					</and>
    					<instanceof value="org.springframework.ide.eclipse.core.io.ZipEntryStorage"/>
    					<instanceof value="org.springframework.ide.eclipse.beans.core.model.IBeansModelElement"/>
    					<instanceof value="org.springframework.ide.eclipse.beans.ui.model.metadata.BeanMetadataNode"/>
    					<instanceof value="org.springframework.ide.eclipse.beans.core.model.metadata.IBeanMetadata"/>
    	            </or>
    	         </enablement>
          </actionProvider>
       </navigatorContent>
    </extension>
    Have a look at BeansNavigatorActionProvider class to see an example on how we add the actions to the menu.

    HTH.

    Christian
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

  3. #3
    Join Date
    Apr 2008
    Posts
    2

    Default Access to Springs jars

    Christian- I am working on a plugin following your suggestion. I am using the XML you provided, and am attempting to use the Java code from FishEye in my own class. But I get many errors similar to the following errors:

    --------------------------------------------------------------

    Code: openAction = new OpenActionWrapperAction(site, openConfigAction, openElementAction);

    Error:
    Access restriction: The constructor OpenActionWrapperAction(ICommonActionExtensionSite , OpenConfigFileAction, OpenJavaElementAction) is not accessible due to restriction on required library C:\Program Files\IBM\SDP70\plugins\org.springframework.ide.ec lipse.beans.ui_2.0.2.v200712142013.jar
    ------------------------------------------------------------------------
    Code: openConfigAction = new OpenConfigFileAction(site);

    Error:
    Access restriction: The type OpenConfigFileAction is not accessible due to restriction on required library C:\Program Files\IBM\SDP70\plugins\org.springframework.ide.ec lipse.beans.ui_2.0.2.v200712142013.jar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •