/** * Sets the selected color. * * @param value the value to set */ public void setValue(String value) { value = value.replace("#", ""); this.value = value; if (rendered) { select(value); } }
@Override protected void afterRender() { super.afterRender(); if (value != null) { String s = getValue(); value = null; select(s); } }
protected void onClick(ComponentEvent ce) { ce.preventDefault(); if (!disabled) { El aElement = ce.getTarget("a", 3); String className = aElement.getStyleName(); if (className.indexOf("color-") != -1) { select( className.substring(className.indexOf("color-") + 6, className.indexOf("color-") + 12)); } } }