Add an action as one of the ToolWindow Options

Answered

Dear Team,

Can someone highlight how can I customise the options list in a ToolWindow Plugin? 

By adding my action to the ActionGroup named “ActiveToolwindowGroup”, the action gets added in the same hierarchy as the three dotted lines (just before the vertical dotted lines) and not as one of the options present as part of the vertical dotted lines.

1.) How can I add one more option to the existing options? Which group should I add my action to such that I can list my action (along with existing options) on click of the three vertical dotted lines? 

2.) Can I replace existing options by my new option?

When I say my option or new option, I mean an action.

0
2 comments

Hi,

  1. You can add your custom action with com.intellij.openapi.wm.ToolWindow#setAdditionalGearActions. See an example: https://github.com/JetBrains/intellij-community/blob/master/platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ExternalProjectsViewImpl.java#L235
  2. It doesn't sound like a good idea to remove/replace existing IDE features with your own. Why do you want to do it?
0

1. Thanks, I'll check this out.

2. In case we wanted to override them with our single option, I thought it would be better to have this clarified. I too felt the same. I was giving this a thought a few hours ago as in, such options give users the flexibility to play around with the tool window without pinning it. Hence, I think I can leave this.

0

Please sign in to leave a comment.