Package com.totsp.gwittir.client.ui

Examples of com.totsp.gwittir.client.ui.ListBox


/** Creates a new instance of TypeSelectorProvider */
    private TypeSelectorProvider() {
    }

    public BoundWidget get() {
        final ListBox box = new ListBox();
        box.setRenderer(new Renderer() {
                public Object render(Object o) {
                    return ((TypeLookup) o).name;
                }
            });
        box.setComparator(new Comparator() {
                public int compare(Object o, Object c) {
                    return ((TypeLookup) o).id.compareTo(((TypeLookup) c).id);
                }
            });
        box.setMultipleSelect(false);

        Services.CONTACTS.getTypeLookups(new AsyncCallback() {
                public void onSuccess(Object result) {
                    box.setOptions((List) result);
                }

                public void onFailure(Throwable caught) {
                    Window.alert("Error getting types - " +
                        caught.getMessage());
View Full Code Here


                LOG.log(Level.SPAM, current.toString(), null);
                calendar.setRenderDate( current );
            }
        });
        hp.add( back );
        month = new ListBox();
        final ArrayList months = new ArrayList();
        for( String monthString : Calendar.MONTHS_OF_YEAR_SHORT ){
            months.add(monthString);
        }
        month.setOptions(months);
View Full Code Here

       
    }
   
    public void xtestOptionsChanges(){
       
        ListBox b = new ListBox();
        ArrayList options = new ArrayList();
        options.add( new Integer( 1 ) );
        options.add( new Integer( 3 ) );
        options.add( new Integer( 5 ) );
        options.add( new Integer( 7 ) );
        options.add( new Integer( 9 ) );
        b.setMultipleSelect( true );
        b.setOptions( options );
        ArrayList selected = new ArrayList();
        selected.add( new Integer( 3 ) );
        selected.add( new Integer( 5 ) );
        selected.add( new Integer( 7 ) );
        b.setModel( selected );
        options = new ArrayList();
        options.add( new Integer( 1 ) );
        options.add( new Integer( 3 ) );
        options.add( new Integer( 7 ) );
        options.add( new Integer( 9 ) );
        b.setOptions( options );
        selected = (ArrayList) b.getModel();
        for( Iterator it = selected.iterator(); it.hasNext(); ){
            System.out.print( it.next() + " " );
        }
        System.out.println();
        this.assertEquals( new Integer( 3 ), selected.get(0) );
View Full Code Here

TOP

Related Classes of com.totsp.gwittir.client.ui.ListBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.