| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> |
| <HEAD> |
| |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| |
| <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
| <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> |
| |
| <LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css"> |
| <TITLE>Adding team actions</TITLE> |
| |
| <link rel="stylesheet" type="text/css" HREF="../book.css"> |
| </HEAD> |
| <BODY BGCOLOR="#ffffff"> |
| <h3> |
| Adding team actions |
| </h3> |
| <p>The team UI plug-in defines a popup menu extension in order to consolidate |
| all team-related actions in one place. The team menu includes many |
| subgroup slots so that team provider plug-ins can contribute actions and have |
| some amount of control over the order of items in the menu. The following |
| markup is from the team UI's plug-in manifest:</p> |
| <pre><extension |
| point="org.eclipse.ui.popupMenus"> |
| <objectContribution |
| id="org.eclipse.team.ui.ResourceContributions" |
| objectClass="org.eclipse.core.resources.IResource" adaptable="true"> |
| <menu |
| id="<b>team.main</b>" |
| path="additions" |
| label="%TeamGroupMenu.label"> |
| <b><separator name="group1"/> |
| <separator name="group2"/> |
| <separator name="group3"/> |
| <separator name="group4"/> |
| <separator name="group5"/> |
| <separator name="group6"/> |
| <separator name="group7"/> |
| <separator name="group8"/> |
| <separator name="group9"/> |
| <separator name="group10"/></b> |
| <separator name="targetGroup"/> |
| <separator name="projectGroup"/> |
| </menu> |
| ... |
| </extension></pre> |
| <p>A team menu is added to the popup menu of all views that show resources (or |
| objects that adapt to resources.) Your plug-in can use the id of this menu |
| and the separator groups in order to add your own menu items. There is |
| nothing to keep you from defining your own popup menus, action sets, or view and |
| editor actions. However, adding your actions to the predefined team menu |
| makes it easier for the end user to find your actions.</p> |
| <p>Let's look at a CVS action that demonstrates some interesting points:</p> |
| <pre><extension |
| point="org.eclipse.ui.popupMenus"> |
| <objectContribution |
| objectClass="org.eclipse.core.resources.IFile" |
| adaptable="true" |
| id="org.eclipse.team.ccvs.ui.IFileContributions"> |
| <filter |
| <b>name="projectPersistentProperty"</b> |
| <b>value="org.eclipse.team.core.repository=org.eclipse.team.cvs.core.cvsnature"></b> |
| </filter> |
| <action |
| label="%IgnoreAction.label" |
| tooltip="%IgnoreAction.tooltip" |
| class="org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction" |
| menubarPath="<b>team.main/group3</b>" |
| helpContextId="org.eclipse.team.cvs.ui.team_ignore_action_context" |
| id="org.eclipse.team.ccvs.ui.ignore"> |
| </action> |
| ...</pre> |
| <p>Note that the action is contributed using the <a href="../reference/extension-points/org_eclipse_ui_popupMenus.html"><b>org.eclipse.ui.popupMenus |
| </b> |
| </a>workbench extension point. Here are some team-specific things |
| happening in the markup:</p> |
| <ul> |
| <li>the action is filtered by a project persistent property which identifies |
| team providers. The value of the property must be of the format <b>"org.eclipse.team.core.repository=<your |
| repository id>"</b> where <b><your repository id></b> is the <b>id</b> |
| provided in the <a href="../reference/extension-points/org_eclipse_team_core_repository.html"> <b> org.eclipse.team.core.repository</b></a> |
| markup. This filter ensures that the CVS popup menu items only appear for |
| files that appear in projects that have been mapped to the CVS repository |
| id.</li> |
| <li>the action is added to a group in the menu that was specified above in the |
| team UI plug-in</li> |
| </ul> |
| <p>The implementation of an action is largely dependent on your specific |
| provider.</p> |
| <p> </p> |
| <p> |
| |
| </p> |
| |
| |
| |
| |
| |
| </BODY> |
| </HTML> |