stringBox.setErrorText(projectValueTextfield, PROJECT_ERROR_TEXT);
stringBox.setErrorText(expirationValueLabel, EXPIRATION_ERROR_TEXT);
stringBox.setErrorText(statusValueLabel, STATUS_ERROR_TEXT);
stringBox.setErrorText(typeValueLabel, TYPE_ERROR_TEXT);
projectRedirector = new TextTargetRedirector() {
@Override
public void methodToRedirect(String data) {
if (stringBox.isOnError(projectRedirector)) {
projectValueTextfield.setForeground(RED);
// disable project button as well
// set the icon to keep it colored
projectButton.setIcon(DEVICE_KO_ICON);
projectButton.setEnabled(false);
} else {
projectValueTextfield.setForeground(GREEN);
projectButton.setIcon(DEVICE_OK_ICON);
projectButton.setEnabled(true);
}
}
};
statusRedirector = new TextTargetRedirector() {
@Override
public void methodToRedirect(String data) {
if (STATUS_RED_VALUE.equalsIgnoreCase(data)) {
statusValueLabel.setForeground(RED);
} else {
statusValueLabel.setForeground(GREEN);
}
}
};
typeRedirector = new TextTargetRedirector() {
@Override
public void methodToRedirect(String data) {
if (TYPE_RED_VALUE.equalsIgnoreCase(data)) {
typeValueLabel.setForeground(RED);
} else {