mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-10-29 19:57:28 +00:00
InputDialog, PasswordDialog, InputTextAreaDialog: simplify propertyChange()
This commit is contained in:
parent
193a9e4c42
commit
0f6bf8565f
@ -164,14 +164,11 @@ public final class InputDialog implements PropertyChangeListener {
|
||||
dialog.setVisible(false);
|
||||
}
|
||||
else if (Res.getString("ok").equals(value)) {
|
||||
stringValue = textArea.getText();
|
||||
if (stringValue.trim().length() == 0) {
|
||||
stringValue = textArea.getText().trim();
|
||||
if (stringValue.isEmpty()) {
|
||||
stringValue = null;
|
||||
}
|
||||
else {
|
||||
stringValue = stringValue.trim();
|
||||
}
|
||||
dialog.setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,13 +217,10 @@ public final class PasswordDialog implements PropertyChangeListener {
|
||||
dialog.setVisible(false);
|
||||
}
|
||||
else if (Res.getString("ok").equals(value)) {
|
||||
stringValue = String.valueOf(passwordField.getPassword());
|
||||
if (stringValue.trim().length() == 0) {
|
||||
stringValue = String.valueOf(passwordField.getPassword()).trim();
|
||||
if (stringValue.isEmpty()) {
|
||||
stringValue = null;
|
||||
}
|
||||
else {
|
||||
stringValue = stringValue.trim();
|
||||
}
|
||||
dialog.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,14 +166,11 @@ public final class InputTextAreaDialog implements PropertyChangeListener {
|
||||
dialog.setVisible(false);
|
||||
}
|
||||
else if (Res.getString("ok").equals(value)) {
|
||||
stringValue = textArea.getText();
|
||||
if (stringValue.trim().length() == 0) {
|
||||
stringValue = textArea.getText().trim();
|
||||
if (stringValue.isEmpty()) {
|
||||
stringValue = "";
|
||||
}
|
||||
else {
|
||||
stringValue = stringValue.trim();
|
||||
}
|
||||
dialog.setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user