#000000 |
WebColor.BLACK |
|
#3F3F3F |
WebColor.DARK_GRAY |
|
#7F7F7F |
WebColor.GRAY |
|
#BFBFBF |
WebColor.LIGHT_GRAY |
|
#FFFFFF |
WebColor.WHITE |
|
#7F0000 |
WebColor.DARK_RED |
|
#FF0000 |
WebColor.RED |
|
#FF7F7F |
WebColor.LIGHT_RED |
|
#007F00 |
WebColor.DARK_GREEN |
|
#00FF00 |
WebColor.GREEN |
|
#7FFF7F |
WebColor.LIGHT_GREEN |
|
#00007F |
WebColor.DARK_BLUE |
|
#0000FF |
WebColor.BLUE |
|
#7F7FFF |
WebColor.LIGHT_BLUE |
|
#7F7F00 |
WebColor.DARK_YELLOW |
|
#FFFF00 |
WebColor.YELLOW |
|
#FFFF7F |
WebColor.LIGHT_YELLOW |
|
WebColor |
.NORMAL_COLOR_STYLE |
|
WebColor |
.NORMAL_COLOR_STYLE_DISABLED |
|
WebColor |
.OK_COLOR_STYLE |
|
WebColor |
.OK_COLOR_STYLE_DISABLED |
|
WebColor |
.PARTLY_COLOR_STYLE |
|
WebColor |
.PARTLY_COLOR_STYLE_DISABLED |
|
WebColor |
.FAILED_COLOR_STYLE |
|
WebColor |
.FAILED_COLOR_STYLE_DISABLED |
|
WebColor |
.ERROR_COLOR_STYLE |
|
WebColor |
.ERROR_COLOR_STYLE_DISABLED |
Use In JSP |
<td>Single Select: <%=strSelect1%><br /> <td> |
<td>Mutiple Select:<br /> </td> <td><%=strSelect2%><br /> </td> |
||
---|---|---|---|---|
Effect |
Single Select:
|
|
||
Java Code |
Select select1 = new Select(); String[][] str2dOptionMatrix = new String[][]{ { "0", "root" }, { "1", "admin" }, { "2", "mgr", "selected" }, { "3", "eng" }, { "4", "custom" }, { "5" }}; select1.appendOptions(str2dOptionMatrix); // Align offset 5, use whitespace before element. String strSelect1 = select1.toString(5, true); String strSelect1CodeShow = WebToolE.text2html(strSelect1); |
Select select2 = new Select(); select2.setMultiple(true); select2.appendOptions(str2dOptionMatrix); select2.setSelected(new String[]{ "1", "3", "5" }); // Align offset 8, use no whitespace before element. String strSelect2 = select2.toString(8); String strSelect2CodeShow = WebToolE.text2html(strSelect2); |
||
Generated Html |
<td>Single Select: <select> <option value="0">root</option> <option value="1">admin</option> <option selected="selected" value="2">mgr</option> <option value="3">eng</option> <option value="4">custom</option> <option value="5"/> </select> </td> |
<td>Mutiple Select:<br /> </td> <td><select multiple="multiple"> <option value="0">root</option> <option selected="selected" value="1">admin</option> <option value="2">mgr</option> <option selected="selected" value="3">eng</option> <option value="4">custom</option> <option selected="selected" value="5"/> </select><br /> </td> |