Hi Roger,

On Mon, Sep 2, 2013 at 6:18 AM, Roger and Beth Whitcomb <
[email protected]> wrote:

>  Hi Ajay,
>     I assume you are doing this in Javascript from inside the bxml file
> itself?!  You should be able to read the included file from there, but I
> can't tell you right now how you would do that.
>

It's not through the Javascript from inside. It's through the code from
Java itself. Here's what I'm trying to do.

protected void changeStyle() {
Component component = Window.getActiveWindow();
if (component instanceof Window) {
 //apply style
System.out.println("style applied");
}
 component = Window.getActiveWindow().getContent();
System.out.println(component);
recChangeStyle(component);
 }

private void recChangeStyle(Component component) {
if (component instanceof Border) {
 //apply style to border
System.out.println("style applied to Border");
component = ((Border) component).getContent();
 recChangeStyle(component, theme);
else if (component.toString().startsWith("org.ajay.stocktrackerapp")) {
 if (component.toString().endsWith("detailPane))
component = (Border) new BXMLSerializer().getNamespace().get(
 "detailPane");
recChangeStyle(component, theme);
} else {
 //applied style to other component
}

}



> If I was doing this, I would wait and do the whole thing in Java after the
> whole hierarchy is loaded, but before displaying anything.  So, my feeling
> is that even if you could get the included file loaded that it still
> wouldn't work right because you would be catching the included file before
> it was loaded, and so your styles would end up getting overridden when it
> did get loaded.
>     Anyone else have a comment??
>
> Thanks,
> ~Roger
>
>
I think that's pretty much what I'm trying to do. I have StockTrackerapp
detailPane as org.ajay.stocktracker.detailPane.bxml.

Hopefully this has made what I'm trying to do more clear.

Reply via email to