Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package org.litesoft.mgwt.client.widgets;

import org.litesoft.commonfoundation.annotations.*;
import org.litesoft.core.util.*;
import org.litesoft.core.util.externalization.*;

import com.google.gwt.event.dom.client.*;
import com.googlecode.mgwt.ui.client.widget.*;

import java.util.*;

public class OptionListBox<T> extends AbstractOptionListWidget<T> {
    private final MListBox mListBox = new MListBox();

    public OptionListBox( @NotNull E13nResolver pResolver, @Nullable SelectedListener<T> pSelectedListener ) {
        super( pResolver, pSelectedListener );
        mListBox.addChangeHandler( new ChangeHandler() {
            @Override
            public void onChange( ChangeEvent event ) {
                processSelectedIndex( mListBox.getSelectedIndex() );
            }
        } );
        initWidget( mListBox );
    }

    public OptionListBox( @NotNull E13nResolver pResolver ) {
        this( pResolver, null );
    }

    public OptionListBox<T> options( @Nullable List<T> pOptions ) {
        setOptions( pOptions );
        return this;
    }

    public OptionListBox<T> options( @Nullable T... pOptions ) {
        setOptions( pOptions );
        return this;
    }

    @Override
    protected void optionsUpdated( @NotNull List<T> pOptions ) {
        mListBox.clear();
        for ( T zOption : pOptions ) {
            mListBox.addItem( DisplayObject.resolve( mResolver, zOption ) );
        }
    }
}

Commits for litesoft/trunk/mobileGWT/mgwtPlus/src/org/litesoft/mgwt/client/widgets/OptionListBox.java

Diff revisions: vs.
Revision Author Commited Message
950 Diff Diff GeorgeS picture GeorgeS Thu 19 Jun, 2014 17:57:04 +0000

New Lines

948 Diff Diff GeorgeS picture GeorgeS Sat 07 Jun, 2014 23:42:39 +0000

Jusefuls Formatter Updated to New Code Format

939 Diff Diff GeorgeS picture GeorgeS Mon 02 Jun, 2014 21:30:31 +0000

Extracting commonfoundation

764 Diff Diff GeorgeS picture GeorgeS Thu 12 Jul, 2012 14:22:25 +0000
756 GeorgeS picture GeorgeS Mon 09 Jul, 2012 04:45:47 +0000