?? selectconst.java
字號:
package cn.hxex.vote.util;
import java.util.HashMap;
import java.util.Iterator;
public class SelectConst {
public static final HashMap voteTypes;
public static final HashMap picTypes;
static {
voteTypes = new HashMap();
voteTypes.put("checkbox", "多選");
voteTypes.put("radio", "單選");
picTypes = new HashMap();
picTypes.put("PIE", "餅圖");
picTypes.put("BAR", "柱狀圖");
picTypes.put("PIE3D", "3D餅圖");
picTypes.put("BAR3D", "3D柱狀圖");
}
/*輸出投票類型的選項信息*/
public static String getVoteTypeOptions(String defaultValue) {
return getOptions(voteTypes, defaultValue);
}
/*將投票類型轉換為顯示信息*/
public static String getVoteTypeTitle(String key) {
return (String) voteTypes.get(key);
}
/*輸出圖形類型的選項信息*/
public static String getPicTypeOptions(String defaultValue) {
return getOptions(picTypes, defaultValue);
}
/*將圖形類型轉換為顯示信息*/
public static String getPicTypeTitle(String key) {
return (String) picTypes.get(key);
}
/*將數據生成顯示的<option>信息*/
public static String getOptions(HashMap options, String defaultValue) {
StringBuffer buf = new StringBuffer();
Iterator keys = options.keySet().iterator();
while (keys.hasNext()) {
String key = (String) keys.next();
buf.append("<option value=\"");
buf.append(key);
if (key.equals(defaultValue)) {
buf.append("\" selected>");
}
else {
buf.append("\" >");
}
buf.append(options.get(key));
buf.append("</option>");
}
return buf.toString();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -