/** * Sets the value to the connector text after formatting the string * representation. * <p> * {@inheritDoc} */ @Override protected void protectedSetConnecteeValue(Object aValue) { if (aValue == null || formatter == null) { super.protectedSetConnecteeValue(aValue); } else { getConnectedJComponent().setText(formatter.format(aValue)); } } }
/** * Sets the value to the connector text after formatting the string * representation. * <p> * {@inheritDoc} */ @SuppressWarnings("unchecked") @Override protected void protectedSetConnecteeValue(Object aValue) { if (aValue == null || formatter == null) { super.protectedSetConnecteeValue(aValue); } else { getConnectedJComponent().setText( ((IFormatter<Object, String>) formatter).format(aValue)); } } }
/** * Gets the value out of the connector text after parsing the string * representation. * <p> * {@inheritDoc} */ @Override protected Object getConnecteeValue() { if (StringUtils.isEmpty(getConnectedJComponent().getText())) { return null; } if (formatter != null) { try { Object value = formatter .parse(getTextForParser(getConnectedJComponent().getText())); getConnectedJComponent().setText(formatter.format(value)); return value; } catch (ParseException ex) { setConnecteeValue(null); return null; } } return super.getConnecteeValue(); }
/** * Gets the value out of the connector text after parsing the string * representation. * <p> * {@inheritDoc} */ @SuppressWarnings("unchecked") @Override protected Object protectedGetConnecteeValue() { if (StringUtils.isEmpty(getConnectedJComponent().getText())) { return null; } if (formatter != null) { try { Object value = formatter .parse(getTextForParser(getConnectedJComponent().getText())); getConnectedJComponent().setText( ((IFormatter<Object, String>) formatter).format(value)); return value; } catch (ParseException ex) { setConnecteeValue(null); return null; } } return super.getConnecteeValue(); }