}
protected void encodeMarkup(FacesContext context, PickList pickList) throws IOException {
ResponseWriter writer = context.getResponseWriter();
String clientId = pickList.getClientId(context);
DualListModel model = (DualListModel) pickList.getValue();
String styleClass = pickList.getStyleClass();
styleClass = styleClass == null ? PickList.CONTAINER_CLASS : PickList.CONTAINER_CLASS + " " + styleClass;
String labelDisplay = pickList.getLabelDisplay();
writer.startElement("div", pickList);
writer.writeAttribute("id", clientId, "id");
writer.writeAttribute("class", styleClass, null);
if(pickList.getStyle() != null) {
writer.writeAttribute("style", pickList.getStyle(), null);
}
//Target List Reorder Buttons
if(pickList.isShowSourceControls()) {
encodeListControls(context, pickList, PickList.SOURCE_CONTROLS, labelDisplay);
}
//Source List
encodeList(context, pickList, clientId + "_source", PickList.SOURCE_CLASS, model.getSource(), pickList.getFacet("sourceCaption"), pickList.isShowSourceFilter());
//Buttons
writer.startElement("div", null);
writer.writeAttribute("class", PickList.BUTTONS_CLASS, null);
writer.startElement("div", null);
writer.writeAttribute("class", PickList.BUTTONS_CELL_CLASS, null);
encodeButton(context, pickList.getAddLabel(), PickList.ADD_BUTTON_CLASS, PickList.ADD_BUTTON_ICON_CLASS, labelDisplay);
encodeButton(context, pickList.getAddAllLabel(), PickList.ADD_ALL_BUTTON_CLASS, PickList.ADD_ALL_BUTTON_ICON_CLASS, labelDisplay);
encodeButton(context, pickList.getRemoveLabel(), PickList.REMOVE_BUTTON_CLASS, PickList.REMOVE_BUTTON_ICON_CLASS, labelDisplay);
encodeButton(context, pickList.getRemoveAllLabel(), PickList.REMOVE_ALL_BUTTON_CLASS, PickList.REMOVE_ALL_BUTTON_ICON_CLASS, labelDisplay);
writer.endElement("div");
writer.endElement("div");
//Target List
encodeList(context, pickList, clientId + "_target", PickList.TARGET_CLASS, model.getTarget(), pickList.getFacet("targetCaption"), pickList.isShowTargetFilter());
//Target List Reorder Buttons
if(pickList.isShowTargetControls()) {
encodeListControls(context, pickList, PickList.TARGET_CONTROLS, labelDisplay);
}