Package org.molgenis.util

Examples of org.molgenis.util.ValueLabel


    List<ValueLabel> valueLabels = new ArrayList<ValueLabel>();
    if (optionLabels == null)
    {
      for (String option : options)
        valueLabels.add(new ValueLabel(option, option));
    }
    else
    {
      if (options.size() != optionLabels.size()) throw new HtmlInputException(
          "List(options) and List(option_labels) should be of same size");
      for (int i = 0; i < options.size(); i++)
      {
        valueLabels.add(new ValueLabel(options.get(i), optionLabels.get(i)));
      }
    }
    this.options = valueLabels;

  }
View Full Code Here


  public void setOptions(String... choices)
  {
    List<ValueLabel> choicePairs = new ArrayList<ValueLabel>();
    for (String choice : choices)
    {
      choicePairs.add(new ValueLabel(choice, choice));
    }
    this.setOptions(choicePairs);
  }
View Full Code Here

  public void setOptionsFromStringList(List<String> choices)
  {
    List<ValueLabel> choicePairs = new ArrayList<ValueLabel>();
    for (String choice : choices)
    {
      choicePairs.add(new ValueLabel(choice, choice));
    }
    this.setOptions(choicePairs);
  }
View Full Code Here

    super(id, value);
  }

  public SelectInput(String id, String value)
  {
    super(id, new ValueLabel(value, value));
  }
View Full Code Here

  public SelectInput setOptions(Map<String, String> options)
  {
    this.options.clear();
    for (Entry<String, String> e : options.entrySet())
    {
      this.options.add(new ValueLabel(e.getKey(), e.getValue()));
    }
    return this;
  }
View Full Code Here

  public SelectInput options(String... options)
  {
    this.options.clear();
    for (String s : options)
    {
      this.options.add(new ValueLabel(s, s));
    }
    return this;
  }
View Full Code Here

    List<ValueLabel> result = new ArrayList<ValueLabel>();
    if (optionLabels != null && optionLabels.size() == optionLabels.size())
    {
      for (int i = 0; i < options.size(); i++)
      {
        result.add(new ValueLabel(options.get(i), optionLabels.get(i)));
      }
    }
    else
    {
      for (String option : options)
      {
        result.add(new ValueLabel(option, option));
      }
    }
    this.setLabel(label);
    this.setNillable(nillable);
    this.setReadonly(readonly);
View Full Code Here

    this.onchange = onchange;
  }

  public void addOption(Object value, Object label)
  {
    this.getOptions().add(new ValueLabel(value.toString(), label.toString()));
  }
View Full Code Here

    }
  }

  public void addOption(Object value, Object label)
  {
    this.getOptions().add(new ValueLabel(value.toString(), label.toString()));
  }
View Full Code Here

  public void setOptions(String... choices)
  {
    List<ValueLabel> choicePairs = new ArrayList<ValueLabel>();
    for (String choice : choices)
    {
      choicePairs.add(new ValueLabel(choice, choice));
    }
    this.setOptions(choicePairs);
  }
View Full Code Here

TOP

Related Classes of org.molgenis.util.ValueLabel

Copyright © 2018 www.massapicom. 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.