JDK-8259916 : Add support for interface default methods in FXML-attributes
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: fxml
  • Affected Version: openjfx11
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2021-01-16
  • Updated: 2021-01-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Description
A DESCRIPTION OF THE PROBLEM :
com.sun.javafx.fxml.BeanAdapter#getClassMethodCache is not checking for interface default methods.

Other people already stumbled across this, too:

https://stackoverflow.com/questions/40360371/are-default-methods-recognized-by-fxml-and-or-scene-builder
https://stackoverflow.com/questions/45641131/javafx-call-default-method-in-scenebuilder-fxml

Implementing this request would allow a large range of mixin-like improvements many projects.

E.g.:
public interface TextProperty
{
	StringProperty textProperty();

	default void setText(final String text)
	{
		textProperty().set(text);
	}

	default String getText()
	{
		return textProperty().get();
	}
}