-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Highlight groups that match any/all of the entries selected in the ma…
…in table. (#2515) * Highlight groups that match any/all of the entries selected in the main table. * Update language * Don't highlight all entries group
- Loading branch information
1 parent
a52d657
commit 2e9e7c8
Showing
48 changed files
with
1,101 additions
and
1,321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package net.sf.jabref.gui.util; | ||
|
||
import java.util.function.Predicate; | ||
|
||
import javafx.beans.binding.Bindings; | ||
import javafx.beans.binding.BooleanBinding; | ||
import javafx.beans.property.BooleanProperty; | ||
import javafx.beans.property.BooleanPropertyBase; | ||
import javafx.beans.value.ObservableValue; | ||
import javafx.collections.ObservableList; | ||
import javafx.css.PseudoClass; | ||
import javafx.scene.Node; | ||
|
||
/** | ||
* Helper methods for javafx binding. | ||
* Some methods are taken from https://bugs.openjdk.java.net/browse/JDK-8134679 | ||
*/ | ||
public class BindingsHelper { | ||
public static <T> BooleanBinding any(ObservableList<T> source, Predicate<T> predicate) { | ||
return Bindings.createBooleanBinding(() -> source.stream().anyMatch(predicate), source); | ||
} | ||
|
||
public static <T> BooleanBinding all(ObservableList<T> source, Predicate<T> predicate) { | ||
// Stream.allMatch() (in contrast to Stream.anyMatch() returns 'true' for empty streams, so this has to be checked explicitly. | ||
return Bindings.createBooleanBinding(() -> !source.isEmpty() && source.stream().allMatch(predicate), source); | ||
} | ||
|
||
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
src/main/java/net/sf/jabref/preferences/HighlightMatchingGroupPreferences.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.