Best way to extend UI which does not provide extension points

I would like to modifiy the Git push dialog for my Gerrit IntelliJ Plugin.

You must push commits to a special remote branch "refs/for/" in order to get them into Gerrit. Currently, IntelliJ does not remember remote branches (see issue IDEA-98693) and an alternate push branch can also not be set up (see issue IDEA-98878). Because of this missing functionality, you need to change the remote branch field in Git push dialog for every commit you want to push to Gerrit.

I have looked into this code and have not found any possibilty to extend this dialog (Action: GitPushAction, Dialog: GitPushDialog).

What I'd like to do: When the push dialog opens, it should autoamtically prepend "refs/for/" in the branch. Also, I'd like to add some more UI like checkboxes for Gerrit options (like submitting the change right after verification (which appends %submit to the push branch)) or an input line for adding reviewers (which appends %r=username1,username2).

I don't like to add a second push action for the plugin (because it should also be shown when using "Commit and Push" in the commit dialog and it would need a lot of code duplication).

How should I try to implement it? Bytecode manipulation with javassist?

Comment actions Permalink

The best solution is to send a pull request to IntelliJ Community Edition adding the extension points that you need.

Comment actions Permalink

If I add such extension points, is there any chance that they will be added before IntelliJ IDEA 14 release?

Dimitry, probably you could also ask your collegues to look into the linked issues and tell me if there are plans that they'll work on it in the nearer feautre. Probably they also have some hints how / where they prefer extension points.


Please sign in to leave a comment.