blob: 2dae19aaecf6a15c7d08e3f2eeb987be1ef45e2b [file] [log] [blame]
<!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.&nbsp;&nbsp; </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 &gt; Customize Perspectives...</b></a>
in
the workbench menu.&nbsp;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.&nbsp; Likewise, if the user marks the action set as hidden, it will always be hidden when the perspective is active.&nbsp; 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.&nbsp; The
following example comes from the Java development tools (JDT) UI plug-in.</P>
<pre>
&lt;extension point=&quot;org.eclipse.ui.actionSetPartAssociations&quot;&gt;
&lt;actionSetPartAssociation
<b>targetID</b>=&quot;org.eclipse.jdt.ui.CodingActionSet&quot;&gt;
&lt;part id=&quot;org.eclipse.jdt.ui.PackageExplorer&quot;/&gt;
&lt;part id=&quot;org.eclipse.jdt.ui.TypeHierarchy&quot; /&gt;
&lt;part id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;/&gt;
&lt;part id=&quot;org.eclipse.jdt.ui.ClassFileEditor&quot;/&gt;
&lt;part id=&quot;org.eclipse.jdt.ui.ProjectsView&quot;/&gt;
&lt;part id=&quot;org.eclipse.jdt.ui.PackagesView&quot;/&gt;
&lt;part id=&quot;org.eclipse.jdt.ui.TypesView&quot;/&gt;
&lt;part id=&quot;org.eclipse.jdt.ui.MembersView&quot;/&gt;
&lt;/actionSetPartAssociation&gt;
&lt;/extension&gt;
</pre>
<P >The <b>targetID</b> specifies the action set.&nbsp; (The <b> CodingActionSet</b> was
previously defined in the JDT plug-in manifest.)&nbsp; 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.&nbsp; 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>