[izpack-changes] r1556 - izpack-src/trunk/src/lib/com/izforge/izpack/panels
noreply at berlios.de
noreply at berlios.de
Fri Sep 1 20:39:39 CEST 2006
Author: eppelman
Date: 2006-09-01 20:39:02 +0200 (Fri, 01 Sep 2006)
New Revision: 1556
Modified:
izpack-src/trunk/src/lib/com/izforge/izpack/panels/RuleInputField.java
Log:
Applied Patch from Dennis Reil, to suppress a NPE that occurs in some cases.
Modified: izpack-src/trunk/src/lib/com/izforge/izpack/panels/RuleInputField.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/panels/RuleInputField.java 2006-09-01 09:58:11 UTC (rev 1555)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/panels/RuleInputField.java 2006-09-01 18:39:02 UTC (rev 1556)
@@ -140,6 +140,7 @@
private int resultFormat = DEFAULT;
private InstallData idata = null;
+
/**
* Holds an instance of the <code>Validator</code> if one was specified and available
*/
@@ -605,8 +606,7 @@
}
}
catch (Throwable exception)
- {
- }
+ {}
}
}
}
@@ -748,17 +748,20 @@
/*--------------------------------------------------------------------------*/
public void caretUpdate(CaretEvent event)
{
- String text = activeField.getText();
- int fieldSize = activeField.getEditLength();
- int caretPosition = activeField.getCaretPosition();
- int selection = activeField.getSelectionEnd() - activeField.getSelectionStart();
+ if (activeField != null)
+ {
+ String text = activeField.getText();
+ int fieldSize = activeField.getEditLength();
+ int caretPosition = activeField.getCaretPosition();
+ int selection = activeField.getSelectionEnd() - activeField.getSelectionStart();
- if ((!inputFields.lastElement().equals(activeField)) && (!activeField.unlimitedEdit()))
- {
- if ((text.length() == fieldSize) && (selection == 0) && (caretPosition == fieldSize)
- && !backstep)
+ if ((!inputFields.lastElement().equals(activeField)) && (!activeField.unlimitedEdit()))
{
- activeField.transferFocus();
+ if ((text.length() == fieldSize) && (selection == 0)
+ && (caretPosition == fieldSize) && !backstep)
+ {
+ activeField.transferFocus();
+ }
}
}
}
More information about the izpack-changes
mailing list