-
Notifications
You must be signed in to change notification settings - Fork 145
WIP: JDK-8186429 FXMLLoader setStaticLoad should be public API #44
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ | |
* questions. | ||
*/ | ||
|
||
import com.sun.javafx.fxml.FXMLLoaderHelper; | ||
import org.junit.Test; | ||
|
||
import java.io.IOException; | ||
|
@@ -39,7 +38,7 @@ public class FXMLLoader_ScriptTest { | |
@SuppressWarnings("deprecation") | ||
public void testStaticScriptLoad() throws IOException { | ||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("static_script_load.fxml")); | ||
FXMLLoaderHelper.setStaticLoad(fxmlLoader, true); | ||
fxmlLoader.setStaticLoad(true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is only called 2 times directly after the constructor it would make sense to add this directly as a param to the constructor. By doing so the field could be defined as final There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for the long gap :) Are you trying to suggest to we can overload the constructor? Something similar to:
Since FXMLoader already has a long list of constructors, do you think this would be a good idea? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not recommend adding any more constructor parameters. If you want to take this new feature forward, it will take a fair bit of work to specify what the effect of staticLoad should be on loading fxml files. It seems like a somewhat of a SceneBuilder-specific mode, but if it has more general use then it could be something to consider. Also, there will need to be several new tests to validate the behavior of various loading scenarios when using static load, including checking what the effects are of switching between modes for successive loads. It might seem simple to "just make this method public", but there is more to it than that. I would also want @johanvos to weigh in, since Gluon now maintains SceneBuilder. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the pointers. I will try to find if this feature has use-cases outside of Scene Builder. |
||
AtomicBoolean scriptCalled = new AtomicBoolean(); | ||
AtomicBoolean scriptEndCalled = new AtomicBoolean(); | ||
fxmlLoader.setLoadListener(new LoadListener() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final FXMLLoader fxmlLoader