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:
parent
a355a0f324
commit
4c25361d1d
1 changed files with 19 additions and 17 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue