Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse plug-in: add Launch command group to Custom Perspective

I have looked for a lot of tutorials online and it is very difficult to find anything related to Launches.

I am implementing an IDE plug-in which implements a custom perspective and I cannot see any of the Run or Debug toolbar buttons except the Run Last Tool button. Everytime I launch the perspective, I need to go into Customize Perspective and then Command Group Visibility and activate the Launch command group.

I have implemented a LaunchConfigurationType and am basically trying to add LaunchShortcuts.

I read somewhere that you need to create an ILaunchable adapter to make the Run as... and Debug as... visible. Here is what I added in the plugin.xml,

<extension point="org.eclipse.core.runtime.adapters">
    <factory adaptableType="org.eclipse.core.resources.IFile" class=" ">
        <adapter type="org.eclipse.debug.ui.actions.ILaunchable">
        </adapter>
    </factory>
</extension>

I have tried many types of adaptableTypes: IResource, IFile, the custom perspective, but none of them make the buttons show up on the toolbar.

like image 578
nbz Avatar asked Dec 02 '10 13:12

nbz


1 Answers

You need to extend your perspective using org.eclipse.ui.perspectiveExtensions extension point. To add Run and Debug buttons add org.eclipse.debug.ui.launchActionSet actionSet like this:

   <extension
         point="org.eclipse.ui.perspectiveExtensions">
      <perspectiveExtension
            targetID="your.perspective.id">
         <actionSet
               id="org.eclipse.debug.ui.launchActionSet">
         </actionSet>
      </perspectiveExtension>
   </extension>
like image 114
dreo Avatar answered Nov 15 '22 08:11

dreo