Otavio Macedo
Otavio Macedo

Reputation: 1572

How to enable/disable the finish button on the IDEA's wizard?

I noticed that the method getFinishButton() in the class com.intellij.ide.wizard.AbstractWizard, from the Intellij IDEA Open API, is deprecated. But there is no comment on the method and I couldn't find any documentation. What I need to do is just enable/disable the button. So, any method for doing this (even of not accessing the object directly) is fine. How can I do this?

Upvotes: 0

Views: 272

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 402235

Finish button is available only on the last step of the wizard, so you should use getNextButton() on the final step to get this button.

There was a refactoring to remove the separate Finish button and now Next button becomes Finish button on the last step.

getFinishButton() must not be used as it's just a stub:

  protected JButton getFinishButton() {
    return new JButton();
  }

To disable the Finish button override the canGoNext() method and return false when needed (or override canFinish() instead).

Upvotes: 1

Related Questions