Announcement Announcement Module
Collapse
No announcement yet.
extending the Spring Explorer view Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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

      Comment

      Working...
      X