Hi all,
I'm ready to look better at this, maybe to include in 2.0.3 (soon to
be released) ...

Objections from someone for including this ?
If not I'll create a jira issue (and post here the link) , but I need
the original author to attach there the code, so we are all happy (due
to ASF rules) :-) ... ok ?

Tell me.

Thanks,
Sandro


2012/11/8 treponema <[email protected]>:
> Hi,
> Sorry for this late answer.
> This is the more generic helper that I use on different windows :
>
> private static class CheckboxMapping<T> implements
> Button.ButtonDataBindMapping {
>         private final Set<Key<T>> set;
>         private final Checkbox cb;
>         private final Key<T> key;
>
>         public CheckboxMapping(Checkbox cb, Key<T> key, Set<Key<T>> set) {
>
>
>             this.cb = cb;
>             this.key = key;
>             this.set = set;
>
>         }
>
>         @Override
>         public Object toButtonData(Object value) {
>             if (value != null && ((List<Key<T>>) value).contains(key))
>                 cb.setSelected(true);
>             else
>                 cb.setSelected(false);
>
>             return cb.getButtonData();
>         }
>
>         @Override
>         public Object valueOf(Object buttonData) {
>             if (cb.isSelected())
>                 set.add(this.key);
>             return new ArrayList<Key<T>>(set);
>         }
>
>     }
>

Reply via email to