So this is how I was using the wizard:
MyCustomWizard wizard = new MyCustomWizard ("title");
WizardDialog wizardDialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
wizardDialog.open();
Now I created a new class, MyCustomDialog extending the WizardDialog:
public class MyCustomDialog extends WizardDialog {
public MyCustomDialog(Shell parentShell, IWizard newWizard) {
super(parentShell, newWizard);
}
@Override
public void createButtonsForButtonBar(Composite parent){
super.createButtonsForButtonBar(parent);
Button finishButton = getButton(IDialogConstants.FINISH_ID);
finishButton.setText(windowTitle);
}
}
And now I changed the code where I create wizard and wizard dialog as:
MyCustomWizard wizard = new MyCustomWizard ("title");
MyCustomDialog wizardDialog = new MyCustomDialog(Display.getDefault().getActiveShell(), wizard);
wizardDialog.open();
Hope it is useful to someone! :)
Thanks for the help @greg-449 and @Baz