| <!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"> |
| <script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"></script> |
| <TITLE>Action set part associations</TITLE> |
| |
| <link rel="stylesheet" type="text/css" HREF="../book.css"> |
| </HEAD> |
| <BODY BGCOLOR="#ffffff"> |
| <H2> |
| Action set part associations</H2> |
| |
| <P > |
| Once your plug-in defines an <a href="workbench_basicext_actionSets.htm">action |
| set</a>, it can use the |
| <a href="../reference/extension-points/org_eclipse_ui_actionSets.html"><b> org.eclipse.ui.actionSetPartAssociations</b></a> |
| extension point to specify that an action set should be made visible when a |
| particular view or editor is active. </P> |
| |
| <P > |
| Ultimately, the user controls the |
| appearance of action sets using |
| |
| <a class="command-link" href='javascript:executeCommand("org.eclipse.ui.window.customizePerspective")'> |
| <img src="PLUGINS_ROOT/org.eclipse.help/command_link.png"> |
| <b>Window > Customize Perspectives...</b></a> |
| |
| in |
| the workbench menu. If the user marks an action set visible, it will always be visible when the |
| perspective is active, regardless of |
| the active view or editor. Likewise, if the user marks the action set as hidden, it will always be hidden when the perspective is active. If the user does not change the state of |
| an action set in this dialog, then the action set part associations are used to |
| determine the visibility of the action set.</P> |
| |
| |
| <P > |
| The markup for an action set part association is straightforward. The |
| following example comes from the Java development tools (JDT) UI plug-in.</P> |
| <pre> |
| <extension point="org.eclipse.ui.actionSetPartAssociations"> |
| <actionSetPartAssociation |
| <b>targetID</b>="org.eclipse.jdt.ui.CodingActionSet"> |
| <part id="org.eclipse.jdt.ui.PackageExplorer"/> |
| <part id="org.eclipse.jdt.ui.TypeHierarchy" /> |
| <part id="org.eclipse.jdt.ui.CompilationUnitEditor"/> |
| <part id="org.eclipse.jdt.ui.ClassFileEditor"/> |
| <part id="org.eclipse.jdt.ui.ProjectsView"/> |
| <part id="org.eclipse.jdt.ui.PackagesView"/> |
| <part id="org.eclipse.jdt.ui.TypesView"/> |
| <part id="org.eclipse.jdt.ui.MembersView"/> |
| </actionSetPartAssociation> |
| </extension> |
| </pre> |
| <P >The <b>targetID</b> specifies the action set. (The <b> CodingActionSet</b> was |
| previously defined in the JDT plug-in manifest.) One or more <b>part</b> |
| attributes can be specified to indicate which views and editors will cause the |
| action set to become visible in the menus and toolbar. The effect of this extension |
| contribution is that the actions associated with writing Java code will only be |
| visible when one of the specified views is active.</P> |
| |
| |
| |
| |
| |
| </BODY> |
| </HTML> |