
fernice.reflare.light.StyledListCellRenderer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fernice-reflare Show documentation
Show all versions of fernice-reflare Show documentation
CSS integration through fernice-flare in Java Swing as a LookAndFeel
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package fernice.reflare.light
import org.fernice.flare.selector.NonTSPseudoClass
import org.fernice.reflare.element.element
import java.awt.Component
import javax.swing.JList
import javax.swing.ListCellRenderer
interface StyledListCellRenderer : ListCellRenderer {
override fun getListCellRendererComponent(list: JList, value: T, index: Int, isSelected: Boolean, cellHasFocus: Boolean): Component {
val component = getStyledListCellRendererComponent(list, value, index, isSelected, cellHasFocus)
val element = component.element
element.hint(NonTSPseudoClass.Active, isSelected)
element.hint(NonTSPseudoClass.Focus, cellHasFocus)
return component
}
fun getStyledListCellRendererComponent(list: JList, value: T, index: Int, isSelected: Boolean, cellHasFocus: Boolean): Component
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy