Subversion Repositories SmartDukaan

Rev

Rev 2119 | Rev 2359 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2119 Rev 2126
Line 35... Line 35...
35
    @UiField Button generateKeyButton;
35
    @UiField Button generateKeyButton;
36
    @UiField Button closeButton, updateButton;
36
    @UiField Button closeButton, updateButton;
37
    @UiField TextBox itemKey;
37
    @UiField TextBox itemKey;
38
    @UiField ListBox vendor;
38
    @UiField ListBox vendor;
39
 
39
 
-
 
40
    private String ourProductGroup, ourBrand, ourColor, ourModelNum;
-
 
41
    
40
    public VendorMappingDialog() {
42
    public VendorMappingDialog(String ourProductGroup, String ourBrand, String ourModelNum, String ourColor) {
41
        setText("Vendor Item Mapping");
43
        setText("Vendor Item Mapping");
42
        setWidget(binder.createAndBindUi(this));
44
        setWidget(binder.createAndBindUi(this));
43
        setAnimationEnabled(true);
45
        setAnimationEnabled(true);
44
        //setGlassEnabled(true);
46
        //setGlassEnabled(true);
45
        center();
47
        center();
46
        for(Entry<Long, String> e : Utils.getAllVendors().entrySet()){
48
        for(Entry<Long, String> e : Utils.getAllVendors().entrySet()){
47
            vendor.addItem(e.getValue());
49
            vendor.addItem(e.getValue());
48
        }
50
        }
-
 
51
        this.ourProductGroup = ourProductGroup;
-
 
52
        this.ourBrand = ourBrand;
-
 
53
        this.ourModelNum = ourModelNum;
-
 
54
        this.ourColor = ourColor;
49
    }
55
    }
50
 
56
 
51
    public VendorMappingDialog(String itemKey) {
57
    public VendorMappingDialog(String ourProductGroup, String ourBrand, String ourModelNum, String ourColor, String itemKey) {
52
        this();
58
        this(ourProductGroup, ourBrand, ourModelNum, ourColor);
53
        setKey(itemKey);
59
        setKey(itemKey);
54
    }
60
    }
55
 
61
    
56
    public void setKey(String itemKey) {
62
    private void setKey(String itemKey) {
57
        this.itemKey.setText(itemKey);
63
        this.itemKey.setText(itemKey);
58
        this.vendor.setEnabled(false);
64
        this.vendor.setEnabled(false);
59
    }
65
    }
60
 
66
 
61
    public void setVendorMappingUpdateListener(VendorMappingUpdateListener vMappingUpdateListener) {
67
    public void setVendorMappingUpdateListener(VendorMappingUpdateListener vMappingUpdateListener) {
Line 97... Line 103...
97
     }
103
     }
98
    
104
    
99
    @UiHandler("sameAsOurs")
105
    @UiHandler("sameAsOurs")
100
    void setDefaultKeyParams(ClickEvent event) {
106
    void setDefaultKeyParams(ClickEvent event) {
101
        if(sameAsOurs.getValue()) {
107
        if(sameAsOurs.getValue()) {
-
 
108
            productGroup.setText(ourProductGroup);
-
 
109
            brand.setText(ourBrand);
-
 
110
            modelNumber.setText(ourModelNum);
-
 
111
            color.setText(ourColor);
102
            //TODO
112
        } else {
-
 
113
            productGroup.setText("");
-
 
114
            brand.setText("");
103
            Window.alert("Yet to be implemented.");
115
            modelNumber.setText("");
-
 
116
            color.setText("");
104
        }
117
        }
105
    }
118
    }
106
}
119
}