Bug #1344: Fix bug moving the addition of ConstraintViolationListeners to

doAfterCompose instead of constructor.

When doAfterCompose is run, we are sure we are ready to send messages to the
client side.

FEA: ItEr76S04BugFixing
This commit is contained in:
Jacobo Aragunde Pérez 2012-03-02 13:37:16 +01:00
parent a355a0f324
commit 4c25361d1d

View file

@ -73,23 +73,6 @@ public class DependencyComponent extends XulElement implements AfterCompose {
this.source = source;
this.destination = destination;
this.dependency = dependency;
violationListener = Constraint
.onlyOnZKExecution(new IConstraintViolationListener<GanttDate>() {
@Override
public void constraintViolated(Constraint<GanttDate> constraint, GanttDate value) {
violated = true;
sendCSSUpdate();
}
@Override
public void constraintSatisfied(Constraint<GanttDate> constraint, GanttDate value) {
violated = false;
sendCSSUpdate();
}
});
this.dependency.addConstraintViolationListener(violationListener,
Mode.RECEIVE_PENDING);
}
private void sendCSSUpdate() {
@ -117,6 +100,25 @@ public class DependencyComponent extends XulElement implements AfterCompose {
};
this.source.getTask().addFundamentalPropertiesChangeListener(listener);
this.destination.getTask().addFundamentalPropertiesChangeListener(listener);
violationListener = Constraint
.onlyOnZKExecution(new IConstraintViolationListener<GanttDate>() {
@Override
public void constraintViolated(Constraint<GanttDate> constraint, GanttDate value) {
violated = true;
sendCSSUpdate();
}
@Override
public void constraintSatisfied(Constraint<GanttDate> constraint, GanttDate value) {
violated = false;
sendCSSUpdate();
}
});
this.dependency.addConstraintViolationListener(violationListener,
Mode.RECEIVE_PENDING);
listenerAdded = true;
}