pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Todd Volkert <tvolk...@gmail.com>
Subject Re: WTKXSerializer.bind
Date Wed, 05 Aug 2009 10:54:19 GMT
Also, keep in mind that WTKX binding is really just a convenience (though I
admit one I'm fond of).  You can always do the binding manually like so, and
this works even in untrusted code.

button = (PushButton)wtkxSerializer.get("button");
cardPane = (CardPane)wtkxSerializer.get("cardPane");
tablePane = (TablePane)wtkxSerializer.get("myTablePane");

-T

On Tue, Aug 4, 2009 at 10:15 PM, Greg Brown <gkbrown@mac.com> wrote:

> Keep in mind that this only works in trusted code. It won't work if you are
> planning to deploy your app as an applet (using BrowserApplicationContext),
> unless you sign your JARs or declare your members public.
>
>
> On Aug 4, 2009, at 9:14 PM, Scott Lanham wrote:
>
>  Thank you, thank you, thank you :-)
>>
>> On Wed, 5 Aug 2009 11:08:26 am Todd Volkert wrote:
>>
>>> You first load your WTKX file, then you bind the objects loaded by the
>>> serializer to your object by calling bind.  The process generally goes
>>> something like this (off the top of my head, but the gist is right):
>>> public class Foo implements Application {
>>>   private Window window;
>>>
>>>   private @WTKX PushButton button;
>>>   private @WTKX CardPane cardPane;
>>>   private @WTKX(id="myTablePane") TablePane tablePane;
>>>
>>>   @Override
>>>   public void startup(Map<String, String> startupProperties) throws
>>> Exception {
>>>       WTKXSerializer wtkxSerializer = new WTKXSerializer();
>>>       Window window = (Window)wtkxSerializer.readObject(this,
>>> "foo.wtkx"); wtkxSerializer.bind(this, Foo.class);
>>>
>>>       // Now I can use the variables annotated with @WTKX
>>>       ...
>>>   }
>>>
>>>   ...
>>> }
>>>
>>> In that example, you'd expect to see <PushButton wtkx:id="button">,
>>> <CardPane wtkx:id="cardPane">, and <TablePane wtkx:id="tablePane">
>>>
>>> -T
>>>
>>> On Tue, Aug 4, 2009 at 8:31 PM, Scott Lanham <lists@sael.com.au> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have looked at the API docs but am having trouble working out how to
>>>> call WTKXSerializer.bind.
>>>>
>>>> Any help is appreciated.
>>>>
>>>> Thanks,
>>>>
>>>> Scott.
>>>>
>>>
>>
>

Mime
View raw message