Lines 492-501
Link Here
|
492 |
|
492 |
|
493 |
nextButton.setEnabled (next && valid); |
493 |
nextButton.setEnabled (next && valid); |
494 |
previousButton.setEnabled (prev); |
494 |
previousButton.setEnabled (prev); |
495 |
finishButton.setEnabled ( |
495 |
|
496 |
valid && |
496 |
if (current instanceof FinishablePanel) { |
497 |
(!next || (current instanceof FinishPanel)) |
497 |
// check if isFinishPanel |
498 |
); |
498 |
if (((FinishablePanel)current).isFinishPanel ()) { |
|
|
499 |
finishButton.setEnabled (valid); |
500 |
} else { |
501 |
// XXX What if the last panel is not FinishPanel ??? enabled ? |
502 |
finishButton.setEnabled (valid && !next); |
503 |
} |
504 |
} else { |
505 |
// original way |
506 |
finishButton.setEnabled ( |
507 |
valid && |
508 |
(!next || (current instanceof FinishPanel)) |
509 |
); |
510 |
} |
499 |
|
511 |
|
500 |
// nextButton.setVisible (next); |
512 |
// nextButton.setVisible (next); |
501 |
// finishButton.setVisible (!next || (current instanceof FinishPanel)); |
513 |
// finishButton.setVisible (!next || (current instanceof FinishPanel)); |
Lines 1009-1020
Link Here
|
1009 |
* iterators path that would like to have the finish button |
1021 |
* iterators path that would like to have the finish button |
1010 |
* enabled. So both Next and Finish are enabled on panel |
1022 |
* enabled. So both Next and Finish are enabled on panel |
1011 |
* implementing this interface. |
1023 |
* implementing this interface. |
|
|
1024 |
* @deprecated XXX |
1012 |
*/ |
1025 |
*/ |
1013 |
public interface FinishPanel extends Panel { |
1026 |
public interface FinishPanel extends Panel { |
1014 |
} |
1027 |
} |
1015 |
|
1028 |
|
1016 |
/** A special interface for panels that need to do additional |
1029 |
/** A special interface for panels that need to do additional |
1017 |
* validation when Next or Finish button is clicked. |
1030 |
* validation when Next or Finish button is clicked. |
|
|
1031 |
* @since XXX |
1018 |
*/ |
1032 |
*/ |
1019 |
public interface ValidatingPanel extends Panel { |
1033 |
public interface ValidatingPanel extends Panel { |
1020 |
|
1034 |
|
Lines 1024-1033
Link Here
|
1024 |
* state and it is ok to leave it. |
1038 |
* state and it is ok to leave it. |
1025 |
* |
1039 |
* |
1026 |
* @throws WizardValidationException when validation fails |
1040 |
* @throws WizardValidationException when validation fails |
|
|
1041 |
* @since XXX |
1027 |
*/ |
1042 |
*/ |
1028 |
public void validate () throws WizardValidationException; |
1043 |
public void validate () throws WizardValidationException; |
1029 |
} |
1044 |
} |
1030 |
|
1045 |
|
|
|
1046 |
/** A special interface for panels that need to dynamically enabled |
1047 |
* Finish button. |
1048 |
* @since XXX |
1049 |
*/ |
1050 |
public interface FinishablePanel extends Panel { |
1051 |
|
1052 |
/** Specify if this panel would enable Finish button. Finish button is |
1053 |
* enabled if and only if isValid() returns true and isFinishPanel() |
1054 |
* returns true. |
1055 |
* |
1056 |
* @return Finish button could be enabled |
1057 |
* @since XXX |
1058 |
*/ |
1059 |
boolean isFinishPanel(); |
1060 |
} |
1061 |
|
1062 |
|
1063 |
|
1031 |
/** Special iterator that works on an array of <code>Panel</code>s. |
1064 |
/** Special iterator that works on an array of <code>Panel</code>s. |
1032 |
*/ |
1065 |
*/ |
1033 |
public static class ArrayIterator extends Object implements Iterator { |
1066 |
public static class ArrayIterator extends Object implements Iterator { |
Lines 1850-1855
Link Here
|
1850 |
cancelButton.doClick (); |
1883 |
cancelButton.doClick (); |
1851 |
} |
1884 |
} |
1852 |
} |
1885 |
} |
|
|
1886 |
|
1887 |
// helper method, might be removed from code |
1888 |
// returns false if Next button is disabled |
1889 |
boolean isNextEnabled () { |
1890 |
return nextButton.isEnabled (); |
1891 |
} |
1892 |
|
1893 |
// helper method, might be removed from code |
1894 |
// returns false if Finish button is disabled |
1895 |
boolean isFinishEnabled () { |
1896 |
return finishButton.isEnabled (); |
1897 |
} |
1898 |
|
1853 |
|
1899 |
|
1854 |
// helper, make possible close wizard as finish |
1900 |
// helper, make possible close wizard as finish |
1855 |
static class FinishAction extends Object { |
1901 |
static class FinishAction extends Object { |