custom FXML builders in SceneBuilder

Tom Schindl tom.schindl at bestsolution.at
Fri Jan 3 05:28:40 PST 2014


IIRC we agreed while talking about the annotation replacement for
builders that we'll later add a possibility to set a converter on
properties through annotations - back then we only talked about
constructors but this could be expanded to any property.

Tom

On 03.01.14 12:12, Tom Eugelink wrote:
> 
> I think there are two usages of builders:
> - construct compontents / controls programatically (ending in the
> build() call).
> - mapping of FXML attributes to node properties, because in FXML
> everything must be a string.
> 
> For example, CalendarTextField has no builder class in the first sense
> (I used withers for that), but does have a class that converts the
> dateFormats (list of SimpleDateFormat strings) in an fxml file to an
> actual list of DateFormats instances.
> 
> https://github.com/JFXtras/jfxtras-labs/blob/8.0/src/main/java/jfxtras/labs/fxml/CalendarTextFieldBuilder.java
> 
> 
> If you can explain to me how to do this without a builder, but also
> without polluting CalendarTextField with FXML aspects, then I'll change
> the code.
> 
> Tom
> 
> 
> 
> On 2014-1-3 11:44, Eric Le Ponner wrote:
>> When Scene Builder 2.0 found a custom components, it instantiates it
>> using FXMLLoader
>> without making any specific builder setup. So FXMLLoader uses the
>> default JavaFX
>> builder factory.
>>
>> Since builders are deprecated, I'm not sure it make sense for SB to
>> have dependency on them.
>>
>> Eric
>>
>>
>> Le 3 janv. 2014 à 10:55, Tom Eugelink <tbee at tbee.org> a écrit :
>>
>>> I had no problems adding the JFXtras components to SceneBuilder, but
>>> one of the controls has a custom FXML builder. It is present in the
>>> same jar, but how do I tell SceneBuilder to use it? Now when I try to
>>> load an fxml file an exception ("unable to coerse") is shown by
>>> SceneBuilder.
>>>
>>> Tom
>>>
>>>
> 
> 



More information about the openjfx-dev mailing list