Skip to content

Commit

Permalink
refine
Browse files Browse the repository at this point in the history
  • Loading branch information
jumperchen authored and DevChu committed Feb 19, 2024
1 parent 9d0903b commit 79b7801
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -4263,20 +4263,22 @@ private void initBindingAnnotation() {
}

public void enableBindingAnnotation() {
setBindingAnnotation0(true);
toggleBindingAnnotationAndUpdateCount(true);
}

public void disableBindingAnnotation() {
setBindingAnnotation0(false);
toggleBindingAnnotationAndUpdateCount(false);
}

private void setBindingAnnotation0(boolean hasBindingAnnot) {
private void toggleBindingAnnotationAndUpdateCount(boolean hasBindingAnnot) {
AuxInfo auxinf = initAuxInfo();
boolean old = auxinf.hasBindingAnnot;
if (old != hasBindingAnnot) {
int diff = hasBindingAnnot ? 1 : -1;
auxinf.hasBindingAnnot = hasBindingAnnot;
updateSubBindingAnnotationCount(diff * auxinf.subAnnotCnt);
if (auxinf.subAnnotCnt > 0) {
updateSubBindingAnnotationCount(diff * auxinf.subAnnotCnt);
}
}
}

Expand Down

0 comments on commit 79b7801

Please sign in to comment.