--- a/openide.dialogs/src/org/openide/WizardDescriptor.java Wed May 15 07:06:57 2013 +0000
+++ a/openide.dialogs/src/org/openide/WizardDescriptor.java Wed May 15 11:57:50 2013 +0200
@@ -560,6 +560,45 @@
public void setClosingOptions(Object[] options) {
super.setClosingOptions(convertOptions(options));
}
+
+ /**
+ * Setter for the button texts of this WizardDescriptor
instance. Currently supported options are:
+ *
+ *
+ * - {@link #FINISH_OPTION}
+ * - {@link #CANCEL_OPTION}
+ * - {@link #PREVIOUS_OPTION}
+ * - {@link #NEXT_OPTION}
+ *
+ *
+ *
+ *
+ * For more info on the possible options regarding the new text see
+ * {@link Mnemonics#setLocalizedText(javax.swing.AbstractButton, java.lang.String) }.
+ *
+ * @param option the button type whose text shall be set
+ * @param text the text for the button
+ *
+ * @throws IllegalArgumentException if the provided option is not supported
+ *
+ * @see Mnemonics#setLocalizedText(javax.swing.AbstractButton, java.lang.String)
+ */
+ public void setButtonText(final Object option, final String text){
+ final AbstractButton button;
+ if (WizardDescriptor.FINISH_OPTION.equals(option)) {
+ button = finishButton;
+ } else if (WizardDescriptor.CANCEL_OPTION.equals(option)) {
+ button = cancelButton;
+ } else if (WizardDescriptor.PREVIOUS_OPTION.equals(option)) {
+ button = previousButton;
+ } else if (WizardDescriptor.NEXT_OPTION.equals(option)) {
+ button = nextButton;
+ } else {
+ throw new IllegalArgumentException("unsupported option: " + option); // NOI18N
+ }
+
+ Mnemonics.setLocalizedText(button, text);
+ }
/** Converts some options.
*/