private static final String DEFAULT_WIDTH = "250";
private static final String DEFAULT_HEIGHT = "22";
@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
LevelIndicator levelIndicator = (LevelIndicator) component;
Resources.includeJQuery(context);
String clientId = levelIndicator.getClientId(context);
// Render first tag
final ResponseWriter writer = context.getResponseWriter();
writer.startElement("div", levelIndicator);
writer.writeAttribute("id", clientId, "id");
final boolean verticallyOriented = levelIndicator.getOrientation().equals(Orientation.VERTICAL);
String defaultOrientationClass = verticallyOriented ? " vertical" : " horizontal";
writer.writeAttribute("class", Styles.getCSSClass(context,
levelIndicator, levelIndicator.getStyle(), DEFAULT_CLASS + defaultOrientationClass,
levelIndicator.getStyleClass()), null);
Rendering.writeStandardEvents(writer, levelIndicator);
writer.startElement("div", levelIndicator);
writer.writeAttribute("id", getComponentSubPartClientId(context, levelIndicator, DISPLAY_AREA_SUFFIX), "id");
writer.writeAttribute("class", Styles.getCSSClass(context,
levelIndicator, levelIndicator.getDisplayAreaStyle(), DEFAULT_DISPLAY_AREA_CLASS, levelIndicator.getDisplayAreaClass()), null);
writer.endElement("div");
writer.startElement("div", levelIndicator);
writer.writeAttribute("id", getComponentSubPartClientId(context, levelIndicator, LABEL_SUFFIX), "id");
writer.writeAttribute("class", Styles.getCSSClass(context,
levelIndicator, levelIndicator.getLabelStyle(), DEFAULT_LABEL_CLASS, levelIndicator.getLabelClass()), null);
writer.endElement("div");
writer.startElement("div", levelIndicator);
writer.writeAttribute("id", getComponentSubPartClientId(context, levelIndicator, SEGMENT_SUFFIX), "id");
writer.writeAttribute("class", DEFAULT_SEGMENT_CLASS, "class");