Examples of ColorPickerField


Examples of org.geoserver.web.wicket.ColorPickerField

    // the color picker. Notice that we need to convert between RRGGBB and
    // #RRGGBB,
    // passing in a Color.class param is just a trick to force the component
    // to use
    // the converter both ways
    ColorPickerField textField = new ColorPickerField("paramValue",
        paramVale, Color.class) {
      @Override
      public IConverter getConverter(Class type) {
        return new IConverter() {

          public String convertToString(Object value, Locale locale) {
            String input = (String) value;
            if (input.startsWith("#"))
              return input.substring(1);
            else
              return input;
          }

          public Object convertToObject(String value, Locale locale) {
            if (value.equals(""))
              return value;
            return "#" + value;
          }
        };
      }
    };
    textField.setRequired(required);
    // set the label to be the paramLabelModel otherwise a validation error
    // would look like
    // "Parameter 'paramValue' is required"
    textField.setLabel(paramLabelModel);

    if (validators != null) {
      for (IValidator validator : validators) {
        textField.add(validator);
      }
    }
    FormComponentFeedbackBorder feedback = new FormComponentFeedbackBorder(
        "border");
    feedback.add(textField);
View Full Code Here

Examples of org.geoserver.web.wicket.ColorPickerField

    // the color picker. Notice that we need to convert between RRGGBB and
    // #RRGGBB,
    // passing in a Color.class param is just a trick to force the component
    // to use
    // the converter both ways
    ColorPickerField textField = new ColorPickerField("paramValue",
        paramVale, Color.class) {
      @Override
      public IConverter getConverter(Class type) {
        return new IConverter() {

          public String convertToString(Object value, Locale locale) {
            String input = (String) value;
            if (input.startsWith("#"))
              return input.substring(1);
            else
              return input;
          }

          public Object convertToObject(String value, Locale locale) {
            if (value.equals(""))
              return value;
            return "#" + value;
          }
        };
      }
    };
    textField.setRequired(required);
    // set the label to be the paramLabelModel otherwise a validation error
    // would look like
    // "Parameter 'paramValue' is required"
    textField.setLabel(paramLabelModel);

    if (validators != null) {
      for (IValidator validator : validators) {
        textField.add(validator);
      }
    }
    FormComponentFeedbackBorder feedback = new FormComponentFeedbackBorder(
        "border");
    feedback.add(textField);
View Full Code Here

Examples of org.geoserver.web.wicket.ColorPickerField

    // the color picker. Notice that we need to convert between RRGGBB and
    // #RRGGBB,
    // passing in a Color.class param is just a trick to force the component
    // to use
    // the converter both ways
    ColorPickerField textField = new ColorPickerField("paramValue",
        paramVale, Color.class) {
      @Override
      public IConverter getConverter(Class type) {
        return new IConverter() {

          public String convertToString(Object value, Locale locale) {
            String input = (String) value;
            if (input.startsWith("#"))
              return input.substring(1);
            else
              return input;
          }

          public Object convertToObject(String value, Locale locale) {
            if (value.equals(""))
              return value;
            return "#" + value;
          }
        };
      }
    };
    textField.setRequired(required);
    // set the label to be the paramLabelModel otherwise a validation error
    // would look like
    // "Parameter 'paramValue' is required"
    textField.setLabel(paramLabelModel);

    if (validators != null) {
      for (IValidator validator : validators) {
        textField.add(validator);
      }
    }
    FormComponentFeedbackBorder feedback = new FormComponentFeedbackBorder(
        "border");
    feedback.add(textField);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.