-
Notifications
You must be signed in to change notification settings - Fork 222
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
PR #46 did not completely fix Maven support #151
Comments
Original comment by Lennard Fonteijn (Bitbucket: LennardF1989, GitHub: LennardF1989): Just a follow-up, I have succesfully created the "nice" fix using the
Option 2 seems like a waste, but it has the added effect of populating the controller dropdown in the UI, whereas option 1 will only displays the current controller in the dropdown. In both cases however, you can still manually type a new path that's not in the dropdown yet and make it take effect immediately (after a save). I'm leaning towards option 2 myself as the final solution. On a side node, With the above in mind though, from a performance point of view, I can probably use a modified version of |
Original comment by Kerry Billingham (Bitbucket: kerry, GitHub: kerry): Hi, But obviously that is my assumption as I prefer standard over bespoke ways of doing things so there is a commandline switch to turn off this behaviour. My only concern is that to try and accommodate all permutations of where the controller file might be placed the code ends up being too complex and there will always be edge cases one forgets about. There didn't seem to be any strong argument to me to not put the FXML file under the same package thus this simple solution was offered. |
Originally reported by: Lennard Fonteijn (Bitbucket: LennardF1989, GitHub: LennardF1989)
Having a Maven project, I was wondering why I could not select @FXML-annotated things from my controller in Scene Builder (running 8.4.1). I looked at the changes of PR #46, and found a huge oversight in this fix.
Situation
Consider the following standard setup of folders:
Problem
Right now, the Maven fix from PR #46 does the following.
Solution
As you can see, grabbing the parent inside step 2 is a pretty naive approach, as you'll end up looking inside a non-existing folder, or plain wrong folder for that matter.
The code should instead start scanning from "src/main/java" up to a configurable depth.
From a performance point of view, I understand you don't want to recursively walk through your whole file-tree. But in most cases, you can prevent doing so by considering the fx:controller attribute in the FXML. Which also removes the need for "guessing" file-names unless absolutely nescessary.
I can easily provide a PR to fix this issue, if someone can give his thoughts on a potential fix. Recursively scanning everything is the quick-n-dirty fix, using the fx:controller when available the nice one. Thoughts?
The text was updated successfully, but these errors were encountered: