String event = getEvent();
String attachTo = getAttachTo();
if (event != null && event.length() != 0) {
if (attachTo == null || attachTo.length() == 0) {
parent.setValueBinding(event, new EventValueBinding(this));
} else {
ValueBinding vb = parent.getValueBinding(event);
if (vb instanceof EventValueBinding) {
//TODO check if that's EventValueBinding for us
parent.setValueBinding(event, null);