JDK-8090679 : More Interfaces
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: controls
  • Priority: P5
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2014-07-29
  • Updated: 2025-06-03
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
Related Reports
Relates :  
Description
many Controls has a TextProperty
but i must check (instanceof) and cast all Controls separatly

if (node instanceof Labeled)
{
Language.bind(((Labeled) node).textProperty());
}
if (node instanceof Tab) 
{
Language.bind(((Tab) node).textProperty());
}
if (node instanceof TableColumn) 
{
Language.bind(((TableColumn) node).textProperty());
}

an Interface ITextProperty was very nice
so i has only check and cast:

if (node instanceof ITextProperty) 
{
Language.bind(((ITextProperty) node).textProperty());
}

same as graphic / content / {min / pref / max}{width/height}Property
Comments
I like the idea of trait-like interfaces in general. Not sure if I like the way it was proposed to be grouped like public final class javafx.scene.Trait { public interface Visible { I usually express with "HasXX" or "CanBeXX" (HasProperties, CanBeVisible), and those are declared as standalone interfaces, not a part of any class - for flexibility. The standalone nature might be especially useful in JavaFX because we have parallel hierarchies (Node/EventHandler) unlike AWT/Swing (Component).
03-06-2025

Yes, I was digging around and saw this and recalled https://mail.openjdk.org/pipermail/openjfx-dev/2023-September/042255.html. I assigned it quickly just to be able to find it more easily later. Since you linked it to a modern issue, I can un-assign myself, or you can take the assignment if you want. I don't intend to work on this currently, but I think these unification ideas have merit (and as I mention in the mailing list above, I do this in my own code too).
03-06-2025

We had a similar discussion in JDK-8313650 which ended up with nothing. If I remember correctly, the word "traits" has been thrown around.
03-06-2025