Contributing Actions to the iSeries Project View

Contributing actions to the iSeries Project view can be done by using the base Eclipse extension point org.eclipse.ui.popupMenus.

Here is a sample on how to do it:

 <!-- =========== Contributing PopUp actions for iSeries Projects ============  -->
 <!-- iSeries Project Perspective supports all the Eclipse based extension points, and so this -->
 <!-- contribution uses the Eclipse pop-up extension point to contribute a menu action to all -->
 <!-- iSeries projects. Notice that filtering is also supported, and notice that the iSeries project -->
 <!-- object model is used.  -->

  <extension point="org.eclipse.ui.popupMenus">
      <objectContribution
            objectClass="com.ibm.etools.iseries.perspective.model.AbstractISeriesProject"
            id="com.ibm.etools.iseries.perspective.isv.sample1.action1">
         <filter
               name="isLocal"
               value="true">
         </filter>
         <action
               label="%enable_isv_property_page"
               class="com.ibm.etools.iseries.perspective.isv.sample1.SetISVBooleanPropertyAction"
               enablesFor="1"
               id="enableisvpage">
         </action>
     </objectContribution>

     <objectContribution
            objectClass="com.ibm.etools.iseries.perspective.model.AbstractISeriesResource"
            id="com.ibm.etools.iseries.perspective.isv.sample1.action2">
         <filter
               name="isLocal"
               value="true">
         </filter>
         <action
               label="%clear_cached_properties"
               class="com.ibm.etools.iseries.perspective.isv.sample1.ClearCachedPropertiesAction"
               enablesFor="1"
               id="clearcache">
         </action>
     </objectContribution>

  </extension>

The above sample contributes two actions to the iSeries Project view, one appears on all iSeries Projects, and one appears on all items in the view (in other words, projects, source physical files and members). This is determined by the value of the objectClass attribute. Eclipse filtering is also used to narrow down the contribution of both actions to only local objects. The valid filter values are all the standard eclipse filter values plus iSeries specific ones defined in the com.ibm.etools.iseries.perspective.model.IISeriesResourceActionFilter class as described in this class hierarchy.

The above snippet is taken from one of the samples included with the iSeries Project perspective. You can check the Installing and Running the Samples section for details about this sample.