<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
adaptable="true"
id="com.qualityeclipse.favorites.popUpMenu"
objectClass="org.eclipse.core.resources.IResource">
<action
class="com.qualityeclipse.favorites.actions.AddToFavoritesActionDelegate"
enablesFor="+"
icon="icons/sample.gif"
id="com.qualityeclipse.favorites.addToFavorites"
label="Add"
menubarPath="com.qualityeclipse.favorites.popupSubMenu/content"
tooltip="Add the selected resource(s) to the Favorites view">
</action>
<menu
id="com.qualityeclipse.favorites.popupSubMenu"
label="Favorites"
path="additions">
<groupMarker
name="content">
</groupMarker>
<separator
name="additions">
</separator>
</menu>
</objectContribution>
</extension>
1.objectClass属性指定当用户点击什么类型的资源时,右键菜单可见
2.id="com.qualityeclipse.favorites.popupSubMenu"指定右键菜单的id
3. <groupMarker
name="content">
</groupMarker>
用于在右键菜单中指定一个分组
4. <separator
name="additions">
</separator>
用于指定右键菜单的一个可扩展点,用于其它plugin扩展这个右键菜单
5.menubarPath="com.qualityeclipse.favorites.popupSubMenu/content"
用于指定这个action的Insertion Point.