Changeset 1080

Show
Ignore:
Timestamp:
10/15/07 13:50:21 (1 year ago)
Author:
yuanying
Message:

add constructor.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • org.jalcedo.client.examples/trunk/org.jalcedo.client.examples.beans.crud/src/org/jalcedo/client/examples/beans/crud/views/PeapleMasterDetailComposite.java

    r1055 r1080  
    3535public class PeapleMasterDetailComposite extends Composite { 
    3636     
     37    private DataBindingContext dbc = null; 
     38     
    3739    private IObservableList masterData = null; 
    3840 
     
    5456    private Text ageText = null; 
    5557 
    56     public PeapleMasterDetailComposite(Composite parent, int style, IObservableList list) { 
     58    public PeapleMasterDetailComposite(Composite parent, int style, IObservableList list, DataBindingContext dbc) { 
    5759        super(parent, style); 
     60        this.dbc = dbc; 
    5861        this.masterData = list; 
    5962        initialize(); 
     
    6164        initializeActions(); 
    6265    } 
     66 
     67    public PeapleMasterDetailComposite(Composite parent, int style, List<Person> personList, DataBindingContext dbc) { 
     68        this(parent, style, new WritableList(personList, Person.class), dbc); 
     69    } 
    6370     
    6471    public PeapleMasterDetailComposite(Composite parent, int style, List<Person> personList) { 
    65         this(parent, style, new WritableList(personList, Person.class)); 
     72        this(parent, style, personList, null); 
    6673    } 
    6774     
    6875    public PeapleMasterDetailComposite(Composite parent, int style) { 
    69         this(parent, style, new WritableList()); 
     76        this(parent, style, new WritableList(), null); 
    7077    } 
    7178 
     
    103110        .observeDetailValue(Realm.getDefault(), selection, "age", int.class); 
    104111         
    105         DataBindingContext dbc = new DataBindingContext(); 
     112        if (dbc == null) { 
     113            dbc = new DataBindingContext(); 
     114        } 
    106115         
    107116        dbc.bindValue(