Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Plug-in Developer Guide
Previous Page Home Next Page

Action set part associations

Once your plug-in defines an actionset, it can use the org.eclipse.ui.actionSetPartAssociations extension point to specify that an action set should be made visible when a particular view or editor is active.  

Ultimately, the user controls the appearance of action sets using Window > Customize Perspectives... 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.

The markup for an action set part association is straightforward.  The following example comes from the Java development tools (JDT) UI plug-in.

   <extension point="org.eclipse.ui.actionSetPartAssociations">
	<actionSetPartAssociation 
		targetID="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>

The targetID specifies the action set.  (The CodingActionSet was previously defined in the JDT plug-in manifest.)  One or more part 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.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire