Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SceneBuilder broken when styleClass element has only one child #131

Closed
gluon-bot opened this issue May 9, 2017 · 4 comments
Closed

SceneBuilder broken when styleClass element has only one child #131

gluon-bot opened this issue May 9, 2017 · 4 comments
Labels
bug Something isn't working critical

Comments

@gluon-bot
Copy link

Originally reported by: Anonymous


Hi,
we found out that SceneBuilder has a problem with following code snippet:

#!fxml

<VBox xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1">
   <children>
      <Label text="Label 1">
         <styleClass>
            <String fx:value="style1" />
         </styleClass>
      </Label>
      <Label text="Label 2" />
   </children>
</VBox>

When you open this in SceneBuilder and try to delete the second Label, nothing happens. The reason herefore is that the styleClass element of the first Label has only one children. When we add a second one, all seems to be fine.
This issue does only occur when the file was manipulated manually, SceneBuilder usually saves a single styleClass as attribute and creates an element only for more than one styleClass names.


@gluon-bot
Copy link
Author

Original comment by Stefan Barth (Bitbucket: sistbart, GitHub: Unknown):


Additional info: I tested this with SceneBuilder version 8.2 and 8.3 on Windows 10

@gluon-bot
Copy link
Author

Original comment by Jose Pereda (Bitbucket: JPereda, GitHub: JPereda):


I can reproduce the issue, not only with styleClass but with some other styleable properties like textFill.

Not only you can't delete the second label, but any change apply to it won't be saved to the FXML file. It happens even if you have only that first label.

It works fine (as expected) with graphic, though.

Doing some debugging, it seems FXOMSaver doesn't inspect the inner classes, so it doesn't add the import for String in case of styleClass or the import for Color for textFill.

This has something to do with a PR for issue #18 that was merged a while ago, trying to optimize the imports in an FXML file: All the "inner" properties FXOMPropertyT are not included.

@gluon-bot
Copy link
Author

Original comment by Jose Pereda (Bitbucket: JPereda, GitHub: JPereda):


I've created a fix for this issue. See PR 54.

@gluon-bot
Copy link
Author

Original comment by Abhinay Agarwal (Bitbucket: abhinayagarwal, GitHub: abhinayagarwal):


The PR has been merged into default branch.

@gluon-bot gluon-bot added critical bug Something isn't working labels May 9, 2018
abhinayagarwal added a commit that referenced this issue May 9, 2018
Issue #131: Fix to add the required imports when using GlueElements

Approved-by: gerardo balderas <[email protected]>
Approved-by: Joeri Sykora <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical
Projects
None yet
Development

No branches or pull requests

1 participant