It's an aspect. Spring root started using this term a lot to describe
partial classes in java. Works quite well which shocked me except the build
process is more complicated but not impossible.
You can write bxml like below on your toplevel object and have it work as
you would expect except where component's are NOT part of the component tree
(which may happen with renderers, but I'll look into that on Fri):
<userData>
<label1>
<ComponentAction targetType="org.apache.pivot.wtk.Label">
<ApplyStyles styles="{backgroundColor:'#ff0000',
font:'Courier 10'}"/>
<ApplyStyles styles="{color:'#0000ff'}"/> <!-- Just
showing multiple style applys -->
</ComponentAction>
</label1>
<blahText>
<ComponentAction targetType="org.apache.pivot.wtk.TextInput">
<triggers>
<Trigger value="{focused:true}">
<ApplyStyles
styles="{backgroundColor:'#0000ff'}"/>
</Trigger>
</triggers>
</ComponentAction>
</blahText>
</userData>
I have some other simpler implementations but they are much more limited in
capabilities. You can make an action anything you want e.g. replace
ApplyStyles with something else. I have a property setter action as well.
None if it is exceptionally well tested and rapid style shifting has some
structural marshalling/unmarshalling issues. I just broke the code adding
global resource dictionaries so I'll have to fix it again tomorrow when I
get a chance.
I think both CSS-like styling and WPF-like-everything-in-XAML are both hard
and complex for various reasons so I don't know what a good answer is to
this. I've probably spent an entire day's worth of hours over the past few
weeks putting this together while learning pivot so the investment is not
large but certainly reinforces GregB's thoughts that this a capability like
this needs more baking time and well-defined objectives.
-----Original Message-----
From: Sandro Martini [mailto:[email protected]]
Sent: Tuesday, June 29, 2010 6:02 PM
To: [email protected]
Subject: Re: [jira] Closed: (PIVOT-435) Override Settings of the Skin with
Json file
Hi,
thanks for your help also on this :-) , probably as Greg said there
will be a full solution in another way, but if there is a simple
(maybe partial) solution now, why not try it ?
Maybe for the 1.5.1 maintenance release ... but after all team members
have tried it :-)
> (assuming json keys can contain dots)
from what I remember Pivot json classes should be able to use dots
inside keys, to have a sort of xpath feature inside data structures
> If you think you could use the ITD, I'll quickly add it before my next
phone call.
yes, I'm curious on this, if you have some spare time to make it I'll
be happy to try ...
Excuse me, what is the "ITD" ?
Bye,
Sandro