Custom buttons in DialogWrapper
Answered
Hello,
I need to replace OK and Cancel buttons in Dialog wrapper with my own buttons. For now I just renamed OK/Cancel but I will need to add more buttons in the same line.
So can you please help with the following questions:
- Is it possible to remove OK/Cancel buttons from dialog (after that I can use createButtonsPanel())
- Is it possible to add more buttons in the same line as OK and Cancel buttons?
There was similar question but I didn't find desired in WizardDialog - https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000651864-DialogWrapper-with-different-buttons
Thank you in advance!
Please sign in to leave a comment.
You should override button creation methods:
You can override `com.intellij.openapi.ui.DialogWrapper#createActions` (and `com.intellij.openapi.ui.DialogWrapper#createLeftSideActions`).
See "Tip of the day" dialog as an example:
https://github.com/JetBrains/intellij-community/blob/master/platform/platform-impl/src/com/intellij/ide/util/TipDialog.java#L76
Aleksey Pivovarov hello, could you be more clear? Maybe with an example. I need to change the name of the button and implement an action. How can I do? Thanks
Sorry, I'm not sure what might be added to 2 answers above.
Maybe, share your code and where it doesn't work as expected?