Let me see if I can even ask this question intelligently:
- I’ve got a package hierarchy where my main program lives in package “a.b.c”. In this directory I have Main.java, Main.json (with the resources) and some “g.bxml” files.
- In this main program I have a helper function that loads an object from a “bxml” file and binds to whatever object you give it. It uses a.b.c.Main as the class and a.b.c.Main for the resources.
- There is a “Sheet1.java” that loads “sheet1.bxml” (all residing in “a.b.c” package) and all works fine and the @BXML variables get set correctly.
- Now I introduce a “a.b.c.d” package and want to load a “dialog.bxml” from this directory from “Dialog1.java” (a.b.c.d.Dialog class) using my same helper function (from a.b.c.Main). First off, using a name of “d/dialog.bxml” loads the file fine and I can see it on screen, BUT none of my @BXML variables inside “a.b.c.d.Dialog” get set, and I get no errors or exceptions.
- Fine – I’m thinking it’s just a package problem, so I copy the helper function into Dialog.java and try to use the same resources from “a.b.c.Main” and it starts giving me “Can’t find resource for base name a.b.c.d.Dialog, locale en_US” messages. Okay, so I have to move the resources into there too, which means more initialization, etc., etc.
So, I guess my question is this: what is the best way to organize the markup files and resource file(s) in this package hierarchy? And what is the “right” way to use the class names to load resources and send to the BXMLSerializer so that my annotated variables get set correctly? Should I always pass the same class name to the serializer (and hence put the resources and bxml files in the same directory(ies)) as the Java classes? If I want to put stuff in a common places (or places) where should that be?
Am I making sense here or is more detail needed? Thanks much!
PHONE +1 650.587.5596
FAX +1 650.587.5550
This transmission is confidential and intended solely for the use of the recipient named above. It may contain confidential, proprietary, or legally privileged information. If you are not the intended recipient, you are hereby notified that any unauthorized review, use, disclosure or distribution is strictly prohibited. If you have received this transmission in error, please contact the sender by reply e-mail and delete the original transmission and all copies from your system.