private void createColorPicker() {
    colorPicker.setValue("000000");

    // Set the selected color to the maplayer
    colorPicker.addListener(
        Events.Select,
        new Listener<ColorPaletteEvent>() {
          @Override
          public void handleEvent(ColorPaletteEvent be) {
            if (!Objects.equal(layer.getMaxColor(), colorPicker.getValue())) {
              layer.setMaxColor(colorPicker.getValue());
              ValueChangeEvent.fire(PolygonLayerOptions.this, layer);
            }
          }
        });

    LabelField labelColor = new LabelField(I18N.CONSTANTS.color());
    add(labelColor);
    add(colorPicker);
  }
 private void updateUI() {
   colorPicker.setValue(layer.getMaxColor());
 }