Skip to content

Commit

Permalink
fixed an issue where corresponding groups are sometimes not highlight…
Browse files Browse the repository at this point in the history
…ed when clicking on entries (#4404)

* fixed an issue where corresponding groups are sometimes not highlighted when clicking on entries
:
the cause of this bug is that the local variable "pseudoClassState" is garbaged by java gc.
there is no reference to this variable except an weak one from "bind" function.

* Remove unused imports

* Update BindingsHelper.java
  • Loading branch information
Fancy Zhang authored and Siedlerchr committed Oct 26, 2018
1 parent e7a65c7 commit 940fa2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#


### Fixed
- We fixed an issue where corresponding groups are sometimes not highlighted when clicking on entries [#3112](https://github.com/JabRef/jabref/issues/3112)
- We fixed an issue where custom exports could not be selected in the 'Export (selected) entries' dialog [#4013](https://github.com/JabRef/jabref/issues/4013)
- Italic text is now rendered correctly. https://github.com/JabRef/jabref/issues/3356
- The entry editor no longer gets corrupted after using the source tab. https://github.com/JabRef/jabref/issues/3532 https://github.com/JabRef/jabref/issues/3608 https://github.com/JabRef/jabref/issues/3616
Expand Down
20 changes: 1 addition & 19 deletions src/main/java/org/jabref/gui/util/BindingsHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import javafx.beans.binding.Bindings;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.binding.StringBinding;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.BooleanPropertyBase;
import javafx.beans.property.ListProperty;
import javafx.beans.property.Property;
import javafx.beans.value.ChangeListener;
Expand Down Expand Up @@ -44,23 +42,7 @@ public static <T> BooleanBinding all(ObservableList<T> source, Predicate<T> pred
}

public static void includePseudoClassWhen(Node node, PseudoClass pseudoClass, ObservableValue<? extends Boolean> condition) {
BooleanProperty pseudoClassState = new BooleanPropertyBase(false) {
@Override
protected void invalidated() {
node.pseudoClassStateChanged(pseudoClass, get());
}

@Override
public Object getBean() {
return node;
}

@Override
public String getName() {
return pseudoClass.getPseudoClassName();
}
};
pseudoClassState.bind(condition);
condition.addListener((obs, oldValue, newValue) -> node.pseudoClassStateChanged(pseudoClass, newValue));
}

/**
Expand Down

0 comments on commit 940fa2c

Please sign in to comment.