0

Is there a way to define custom action set that will be visible only when i switch to my custom perspective?

    extension point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension 
            targetID="com.mycustom.ui.perspective.ApplicationPerspective">              
            <actionSet id="org.eclipse.debug.ui.breakpointActionSet"/> 
            <actionSet id="org.eclipse.debug.ui.launchActionSet"/>
            <actionSet  id="org.eclipse.debug.ui.debugActionSet"/>
            <actionSet
                  id="org.eclipse.mycustom.actionSet">
            </actionSet>
           <hiddenToolBarItem id="org.eclipse.debug.internal.ui.actions.DebugDropDownAction"/>        
        </perspectiveExtension> 
  </extension>

   <extension
         point="org.eclipse.ui.actionSets">
      <actionSet
         label="Sample Action Set"
         visible="false"
         id="org.eclipse.mycustom.actionSet">
           <action
                label="My toolbar item"
                class="org.eclipse.ui.handlers.MYCustomClass"
                id="org.eclipse.ui.commands.customaction">
            </action>
      </actionSet>
   </extension>
dicle
  • 1,122
  • 1
  • 12
  • 40
  • Sure. Just look at how EGit does it, for example. – howlger Mar 03 '20 at 09:34
  • ahh i want to do with plugin.xml in my current project set up like that.. I saw some extension way but it did not fully work since actionSet id not okay. @howlger – dicle Mar 03 '20 at 09:39
  • 1
    I can't imagine what you want that EGit doesn't do. Please show sample code and describe the actual vs. the expected behavior. – howlger Mar 03 '20 at 09:45
  • You use the `org.eclipse.ui.perspectiveExtensions` extension point for this. If you have tried this and had problems show us what you did. – greg-449 Mar 03 '20 at 09:50
  • Hi @greg-449 i have edit my question. Please have a look. Thank you – dicle Mar 03 '20 at 09:54
  • Simply i have one toolbar item custom one the one i have developed. I would like to show that item only when i switch to custom perspective. @greg-449 – dicle Mar 03 '20 at 09:55
  • So you use the `org.eclipse.ui.actionSets` extension point to define the actiion set (it is deprecated but for this you have to use it). – greg-449 Mar 03 '20 at 09:58
  • okay i have edit again and tried to use like this but did not work actually.. Do u think i am missing something? @greg-449 – dicle Mar 03 '20 at 10:13
  • You probably need to reset the perspective to get it to pick up the new extensions. – greg-449 Mar 03 '20 at 10:17
  • no it does not visible unfortunately.. @greg-449 – dicle Mar 03 '20 at 10:25
  • 2
    you have not specified a `menubarPath` or a `toolbarPath` so the action won't be visible anywhere. – greg-449 Mar 03 '20 at 10:43

0 Answers0