Пример #1
0
 /**
  * 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);
   }
 }
Пример #2
0
 @Override
 protected void afterRender() {
   super.afterRender();
   if (value != null) {
     String s = getValue();
     value = null;
     select(s);
   }
 }
Пример #3
0
 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));
     }
   }
 }