June 2004
Beginner to intermediate
364 pages
7h 38m
English
You don’t want users to have to explicitly add your plug-in to a perspective by customizing it.
Use the extension point
org.eclipse.ui.perspectiveExtensions in
plugin.xml to add the plug-in to the perspective
automatically.
To automatically add a plug-in to a perspective, use the extension
point org.eclipse.ui.perspectiveExtensions in
plugin.xml. You can make this just by editing
the XML in plugin.xml. Here’s
how to automatically add the plug-in developed over the previous few
recipes to the Java perspective in plugin.xml:
<?xml version="1.0" encoding="UTF-8"?>
<plugin
id="org.cookbook.ch12.MenuPlugInFromScratch"
name="MenuPlugInFromScratch Plug-in"
version="1.0.0"
provider-name="Eclipse Cookbook"
class="org.cookbook.ch12.MenuPlugInFromScratch.MenuPlugInFromScratchPlugin">
<runtime>
<library name="MenuPlugInFromScratch.jar"/>
</runtime>
<requires>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.ui"/>
</requires>
<extension
point="org.eclipse.ui.actionSets">
<actionSet
label="Action Set 1"
visible="true"
id="org.cookbook.ch12.MenuPlugInFromScratch.actionSet1">
<menu
label="Menu 1"
id="Menu1">
<separator
name="Group1">
</separator>
</menu>
<action
label="Action 1"
class="org.cookbook.ch12.MenuPlugInFromScratch.Action1"
tooltip="This action is functional."
menubarPath="Menu1/Group1"
toolbarPath="Group1"
id="Action1">
</action>
</actionSet>
</extension>
<extension
point = "org.eclipse.ui.perspectiveExtensions"> ...Read now
Unlock full access