code: private static void setTextAndDiscardEdits(JTextComponent field, String value) {
  		if (value == null) {
  			return;
  		}
  
  		field.setText(value);
  		if (field instanceof ZapTextField) {
  			((ZapTextField) field).discardAllEdits();
  		} else if (field instanceof ZapTextArea) {
  			((ZapTextArea) field).discardAllEdits();
  		}
  	}
docs: Sets the given value to the given field.
  <p>
  The edits are discarded after setting the value, if the field is a {@link ZapTextField} or {@link ZapTextArea}.
  
  @param field the field to set the value.
  @param value the value to set.