Eclipse

If you are providing a right click menu for Eclipse like so:

<extension point="org.eclipse.ui.popupMenus">
  <objectContribution
    adaptable="false"
    id="org.openiaml.model.codegen.objectContribution1"
    objectClass="org.eclipse.core.resources.IResource">
  ...
</extension>

It is easy to only enable this for particular file extensions (e.g. “*.iaml”) with a wildcarded name filter:

<extension point="org.eclipse.ui.popupMenus">
  <objectContribution
    adaptable="false"
    id="org.openiaml.model.codegen.objectContribution1"
    nameFilter="*.iaml"
    objectClass="org.eclipse.core.resources.IResource">
  ...
</extension>