[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    API change request (RT-23413)
From:       greg.x.brown () oracle ! com (Greg Brown)
Date:       2012-07-30 16:05:41
Message-ID: 8E8C8EF0-32DD-4160-A4C4-9E9995EC9FD1 () oracle ! com
[Download RAW message or body]

After further discussion (see JIRA), I have revised the proposed API change for \
RT-23413:

  http://javafx-jira.kenai.com/browse/RT-23413

The previous proposal would have added a new boolean property to FXMLLoader called \
"clearImportsOnLoad"; however, this would have required a caller to both set this \
flag and set the document root to null before each call to load(), which is not very \
intuitive.

The revised proposal adds a "template" flag to FXMLLoader. Setting this flag to true \
indicates that the loader will be used as a template for producing multiple instances \
of a single object hierarchy. When this flag is set to false (the default), \
FXMLLoader#load() will behave as currently implemented. When true, FXMLLoader#load() \
will: 

a) clear the root value by calling setRoot(null) 
b) not clear any existing imports 

This helps improve performance on subsequent loads since the overhead of loading the \
classes referred to by the document is eliminated.

Greg

On Jul 20, 2012, at 3:03 PM, Greg Brown wrote:

> Good point. Thanks!
> 
> On Jul 20, 2012, at 2:59 PM, Daniel Fuchs wrote:
> 
> > Hi,
> > 
> > Whatever option you choose, I think you need to clear the imports if the \
> > ClassLoader changes. Otherwise you might use the class that was returned by the \
> > previous ClassLoader, which would be bad.
> > Also you probably need to specify what happens if the default class loader is \
> > changed. Does that affect existing FXMLLoader instances? I guess not...
> > "Sets the default ClassLoader" is maybe a bit too concise ;-)
> > 
> > best regards,
> > 
> > -- daniel
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic