Verified Owner
Top Description Fields Constructors Methods
org.jabref.gui.icon

pack-priv Class JabRefFontIcon

extends FontIcon
Class Inheritance
Annotations
@NullMarked
Imports
java.util.List, .Set, javafx.css.CssMetaData, .Styleable, javafx.scene.paint.Paint, org.jspecify.annotations.NullMarked, org.kordamp.ikonli.Ikon, org.kordamp.ikonli.javafx.FontIcon

A FontIcon whose color is chosen in code rather than by the theme -- a group's color, or the gray of a disabled icon. The font-backed counterpart to JabRefSvgIcon.

Plain FontIcon#setIconColor(Paint) is not enough for that: JavaFX lets a value from an author stylesheet win over one set programmatically, so the .glyph-icon and .ikonli-font-icon rules in jabref-base.css would paint the icon in the theme's text color again on the next CSS pass. The usual way out -- reporting the property as not settable -- is closed too, because Ikonli's -fx-icon-color metadata answers CssMetaData#isSettable with a constant true.

What is left is getCssMetaData(): CSS only ever touches the properties a node lists there, so this node lists neither color property. Everything else -- sizes, bounds type -- stays under the theme's control.

Field Summary

Modifier and TypeField and Description
private static final Set<String>
COLOR_PROPERTIES

The properties that color a FontIcon.

private static final List<CssMetaData<? extends Styleable, ?>>
Inherited from org.kordamp.ikonli.javafx.FontIcon:
iconColoriconSize

Constructor Summary

AccessConstructor and Description
pack-priv
JabRefFontIcon(Ikon ikon, int size, Paint color)

Method Summary

Modifier and TypeMethod and Description
public static List<CssMetaData<? extends Styleable, ?>>
getClassCssMetaData()

Hides org.kordamp.ikonli.javafx.FontIcon.getClassCssMetaData.

Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

public List<CssMetaData<? extends Styleable, ?>>
Inherited from org.kordamp.ikonli.javafx.FontIcon:
getIconCodegetIconColorgetIconLiteralgetIconSizeiconCodePropertyiconColorPropertyiconSizePropertyinvalidDescriptionofofofofsetIconCodesetIconColorsetIconLiteralsetIconSizetoString

Field Detail

COLOR_PROPERTIESback to summary
private static final Set<String> COLOR_PROPERTIES

The properties that color a FontIcon. -fx-icon-color feeds -fx-fill through Ikonli's own listener, so both have to go for the color to survive.

CSS_META_DATAback to summary
private static final List<CssMetaData<? extends Styleable, ?>> CSS_META_DATA

Constructor Detail

JabRefFontIconback to summary
pack-priv JabRefFontIcon(Ikon ikon, int size, Paint color)

Method Detail

getClassCssMetaDataback to summary
public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData()

Hides org.kordamp.ikonli.javafx.FontIcon.getClassCssMetaData.

Doc from javafx.scene.text.Text.getClassCssMetaData.

Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

getCssMetaDataback to summary
public List<CssMetaData<? extends Styleable, ?>> getCssMetaData()

Overrides org.kordamp.ikonli.javafx.FontIcon.getCssMetaData.

Implements javafx.css.Styleable.getCssMetaData.

Doc from javafx.css.Styleable.getCssMetaData.

The CssMetaData of this Styleable. This may be returned as an unmodifiable list.

Annotations
@Override