class JDK15EnumPropertySelectionModel implements IPropertySelectionModel {
                private Object[] options;

                @SuppressWarnings("unchecked")
                public SelectionModel(Class<? extends Enum> enumType) {
                        this(EnumSet.allOf(enumType));                          
                }

                @SuppressWarnings("unchecked")
                public SelectionModel(EnumSet set) {
                        ArrayList list = new ArrayList(set);
                        Collections.sort(list);
                        this.options = list.toArray();  
                }

                public int getOptionCount() {
                        return options.length;
                }

                public Object getOption(int index) {
                        return options[index];
                }

                public String getLabel(int index) {
                        options[index].toString();
                }

                public String getValue(int index) {
                        return Integer.toString(index);
                }

                public Object translateValue(String value) {
                        int index;
                        index = Integer.parseInt(value);
                        return options[index];
                }
        }

On 11/14/05, Chris Chiappone <[EMAIL PROTECTED]> wrote:
> I beleive it was removed in tap4 because of jdk 5 and annotations.
>
> On 11/13/05, Human Dunnil <[EMAIL PROTECTED]> wrote:
> > Hi folks,
> > I'm reading Tapestry in Action book, in chapter 4 there is class named
> > EnumPropertySelectionModel, but I can't find it in the latest release of
> > Tapestry (4 beta 11), Is this changed in T4? If so, what's replaced with it?
> >  Thanks in advance,
> > - Human
> >
> >
>
>
> --
> ~chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
The Spindle guy.           http://spindle.sf.net
Get help with Spindle:   
http://lists.sourceforge.net/mailman/listinfo/spindle-user
Announcement Feed:    
http://www.jroller.com/rss/glongman?catname=/Announcements
Feature Updates:            http://spindle.sf.net/updates

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to