PageRenderTime 18ms CodeModel.GetById 11ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/webccr/src/com/emis/caesar/emisNativeSelect.java

https://bitbucket.org/sanliou/synccr
Java | 39 lines | 30 code | 9 blank | 0 comment | 0 complexity | bf4d43989382ce0e3ba62b98caa52a51 MD5 | raw file
 1package com.emis.caesar;
 2
 3import java.sql.*;
 4import java.util.HashMap;
 5import java.util.Iterator;
 6import java.util.Set;
 7
 8import javax.servlet.ServletContext;
 9
10import com.emis.db.*;
11import com.emis.util.emisUtil;
12import com.vaadin.data.Item;
13import com.vaadin.ui.NativeSelect;
14
15public class emisNativeSelect extends NativeSelect {
16    
17	public final emisNativeSelect thisFinal = this;
18	
19	public emisNativeSelect() {
20		super();
21		setInvalidAllowed(false);
22		setNullSelectionAllowed(false);
23		this.setItemCaptionMode(ItemCaptionMode.EXPLICIT_DEFAULTS_ID);
24	}
25	
26	public void init(String tab_name) throws Exception {
27		HashMap map = emisSysTab.getSysTab(tab_name);
28		
29		Set key = map.keySet();
30		Iterator it = key.iterator();
31		while( it.hasNext() ) {
32			Object value = it.next();
33			Object name = map.get(value);
34			Item item = thisFinal.addItem(value);
35			thisFinal.setItemCaption(value,(String) name);
36		}
37
38	}
39}