Examples of Option


Examples of org.spiffyui.client.widgets.multivaluesuggest.MultivalueSuggestBoxBase.Option

        /*
         * get/set/add SelectedOption
         */
        //Now set the values using setSelectedOptions with 3 new Options
        List<Option> options = new ArrayList<Option>();
        options.add(msb.new Option("Brick Red", "#CB4154"));
        options.add(msb.new Option("Goldenrod", "#FCD975"));
        options.add(msb.new Option("Cornflower", "#9ACEEB"));
        msb.setSelectedOptions(options);
       
        //test getValuesAsString
        ok("Brick Red~#CB4154;Goldenrod~#FCD975;Cornflower~#9ACEEB".equals(msb.getValuesAsString()),
            "The values as string after using setSelectedOptions for the multi-valued suggestbox should be 'Brick Red~#CB4154;Goldendrod~#FCD975;Cornflower~#9ACEEB' and is '" + msb.getValuesAsString() + "'");
       
        //test getValueMap
        Map<String, String> mvmSO = msb.getValueMap();
        int j = 0;
        for (String key : mvmSO.keySet()) {
            if (j == 0) {
                ok("Brick Red".equals(key), "The key in the value map at index " + j + " for the multi-valued suggestbox should be 'Brick Red' and is '" + key + "'");
                ok("#CB4154".equals(mvmSO.get(key)), "The value in the value map at index " + j + " for the multi-valued suggestbox should be '#CB4154' and is '" + mvmSO.get(key) + "'");               
            } else if (j == 1) {
                ok("Goldenrod".equals(key), "The key in the value map at index " + j + " for the multi-valued suggestbox should be 'Goldenrod' and is '" + key + "'");
                ok("#FCD975".equals(mvmSO.get(key)), "The value in the value map at index " + j + " for the multi-valued suggestbox should be '#FCD975' and is '" + mvmSO.get(key) + "'");
            } else {
                ok("Cornflower".equals(key), "The key in the value map at index " + j + " for the multi-valued suggestbox should be 'Cornflower' and is '" + key + "'");
                ok("#9ACEEB".equals(mvmSO.get(key)), "The value in the value map at index " + j + " for the multi-valued suggestbox should be '#9ACEEB' and is '" + mvmSO.get(key) + "'");
            }
            j++;
        }
       
        //test getSelectedOptions
        List<Option> selOpts = msb.getSelectedOptions();
        for (int k = 0; k < 3; k++) {
            Option selOpt = selOpts.get(k);
            if (k == 0) {
                ok("Brick Red".equals(selOpt.getName()), "The key in the selected options list at index " + k + " for the multi-valued suggestbox should be 'Brick Red' and is '" + selOpt.getName() + "'");
                ok("#CB4154".equals(selOpt.getValue()), "The value in the selected options list at index " + k + " for the multi-valued suggestbox should be '#CB4154' and is '" + selOpt.getValue() + "'");               
            } else if (k == 1) {
                ok("Goldenrod".equals(selOpt.getName()), "The key in the selected options list at index " + k + " for the multi-valued suggestbox should be 'Goldenrod' and is '" + selOpt.getName() + "'");
                ok("#FCD975".equals(selOpt.getValue()), "The value in the selected options list at index " + k + " for the multi-valued suggestbox should be '#FCD975' and is '" + selOpt.getValue() + "'");
            } else {
                ok("Cornflower".equals(selOpt.getName()), "The key in the selected options list at index " + k + " for the multi-valued suggestbox should be 'Cornflower' and is '" + selOpt.getName() + "'");
                ok("#9ACEEB".equals(selOpt.getValue()), "The value in the selected options list at index " + k + " for the multi-valued suggestbox should be '#9ACEEB' and is '" + selOpt.getValue() + "'");
            }
        }
       
        //Now add Shamrock using addSelectedOption
        Option shamrock = msb.new Option("Shamrock", "#45CEA2");
        msb.addSelectedOption(shamrock);
        //repeat tests of getValuesAsString, getValueMap and getSelectedOptions
        //test getValuesAsString
        ok("Brick Red~#CB4154;Goldenrod~#FCD975;Cornflower~#9ACEEB;Shamrock~#45CEA2".equals(msb.getValuesAsString()),
            "The values as string after using setSelectedOptions for the multi-valued suggestbox should be 'Brick Red~#CB4154;Goldendrod~#FCD975;Cornflower~#9ACEEB;Shamrock~#45CEA2' and is '" + msb.getValuesAsString() + "'");
       
        //test getValueMap
        Map<String, String> mvmSO2 = msb.getValueMap();
        int l = 0;
        for (String key : mvmSO2.keySet()) {
            if (l == 0) {
                ok("Brick Red".equals(key), "The key in the value map at index " + l + " for the multi-valued suggestbox should be 'Brick Red' and is '" + key + "'");
                ok("#CB4154".equals(mvmSO2.get(key)), "The value in the value map for the multi-valued suggestbox should be '#CB4154' and is '" + mvmSO2.get(key) + "'");               
            } else if (l == 1) {
                ok("Goldenrod".equals(key), "The key in the value map at index " + l + " for the multi-valued suggestbox should be 'Goldenrod' and is '" + key + "'");
                ok("#FCD975".equals(mvmSO2.get(key)), "The value in the value map for the multi-valued suggestbox should be '#FCD975' and is '" + mvmSO2.get(key) + "'");
            } else if (l == 2) {
                ok("Cornflower".equals(key), "The key in the value map at index " + l + " for the multi-valued suggestbox should be 'Cornflower' and is '" + key + "'");
                ok("#9ACEEB".equals(mvmSO2.get(key)), "The value in the value map for the multi-valued suggestbox should be '#9ACEEB' and is '" + mvmSO2.get(key) + "'");
            } else {
                ok("Shamrock".equals(key), "The key in the value map at index " + l + " for the multi-valued suggestbox should be 'Shamrock' and is '" + key + "'");
                ok("#45CEA2".equals(mvmSO2.get(key)), "The value in the value map for the multi-valued suggestbox should be '#45CEA2' and is '" + mvmSO2.get(key) + "'");
            }
            l++;
        }
       
        //test getSelectedOptions
        List<Option> selOpts2 = msb.getSelectedOptions();
        for (int m = 0; m < 4; m++) {
            Option selOpt = selOpts2.get(m);
            if (m == 0) {
                ok("Brick Red".equals(selOpt.getName()), "The key in the selected options list at index " + m + " for the multi-valued suggestbox should be 'Brick Red' and is '" + selOpt.getName() + "'");
                ok("#CB4154".equals(selOpt.getValue()), "The value in the selected options list at index " + m + " for the multi-valued suggestbox should be '#CB4154' and is '" + selOpt.getValue() + "'");               
            } else if (m == 1) {
                ok("Goldenrod".equals(selOpt.getName()), "The key in the selected options list at index " + m + " for the multi-valued suggestbox should be 'Goldenrod' and is '" + selOpt.getName() + "'");
                ok("#FCD975".equals(selOpt.getValue()), "The value in the selected options list at index " + m + " for the multi-valued suggestbox should be '#FCD975' and is '" + selOpt.getValue() + "'");
            } else if (m == 2) {
                ok("Cornflower".equals(selOpt.getName()), "The key in the selected options list at index " + m + " for the multi-valued suggestbox should be 'Cornflower' and is '" + selOpt.getName() + "'");
                ok("#9ACEEB".equals(selOpt.getValue()), "The value in the selected options list at index " + m + " for the multi-valued suggestbox should be '#9ACEEB' and is '" + selOpt.getValue() + "'");
            } else {
                ok("Shamrock".equals(selOpt.getName()), "The key in the selected options list at index " + m + " for the multi-valued suggestbox should be 'Shamrock' and is '" + selOpt.getName() + "'");
                ok("#45CEA2".equals(selOpt.getValue()), "The value in the selected options list at index " + m + " for the multi-valued suggestbox should be '#45CEA2' and is '" + selOpt.getValue() + "'");              
            }
        }
       
        g_panel.add(msb, WIDGETS_ID);
    }
View Full Code Here

Examples of org.springframework.cassandra.core.keyspace.Option

        mapFirst = false;
      } else {
        cql.append(", ");
      }

      Option option = entry.getKey();
      cql.append(singleQuote(option.getName())); // entries in map keys are always quoted
      cql.append(" : ");
      Object entryValue = entry.getValue();
      entryValue = entryValue == null ? "" : entryValue.toString();
      if (option.escapesValue()) {
        entryValue = escapeSingle(entryValue);
      }
      if (option.quotesValue()) {
        entryValue = singleQuote(entryValue);
      }
      cql.append(entryValue);
    }
    cql.append(" }");
View Full Code Here

Examples of org.springmodules.xt.ajax.component.Option

        // Get offices:
        Collection<IOffice> offices = store.getOffices();
       
        // Create the component to render (a list of html option elements):
        List options = new LinkedList();
        Option first = new Option("-1", "Select one ...");
        options.add(first);
        for(IOffice office : offices) {
            Option option = new Option(office, "officeId", "name");
            options.add(option);
        }
        // Create an ajax action for replacing the content of the "offices" element with the components just created:
        ReplaceContentAction action = new ReplaceContentAction("offices", options);
       
View Full Code Here

Examples of org.teiid.query.sql.lang.Option

        Select select = new Select();
        ElementSymbol a = new ElementSymbol("a")//$NON-NLS-1$
        select.addSymbol(a);

        Option option = new Option();
        option.setNoCache(true);
        option.addNoCacheGroup("a.b.c"); //$NON-NLS-1$

        Query query = new Query();
        query.setSelect(select);
        query.setFrom(from);
        query.setOption(option);
View Full Code Here

Examples of org.xnio.Option

            final String xnioOptionName = property.getName();
            final String value = property.getValue().asString();

            final String fullyQualifiedOptionName = Options.class.getName() + "." + xnioOptionName;
            // create the XNIO option for the option name
            final Option connectionCreationOption = Option.fromString(fullyQualifiedOptionName, Options.class.getClassLoader());
            // now parse and set the value
            optionMapBuilder.parse(connectionCreationOption, value);
        }
        return optionMapBuilder.getMap();
    }
View Full Code Here

Examples of pt.opensoft.html.Option

    }
   
    public void setSelected(String name) {
        int idx = -1;
        for (Iterator iterator = options.iterator(); iterator.hasNext(); idx++) {
            Option option = (Option) iterator.next();
            if (option.getValue().equals(name)) {
                selectedIndex = idx;
            }
        }   
    }
View Full Code Here

Examples of scala.Option

        scala.collection.immutable.List<Authorization> authorizations = emptyScalaList();
        if (null != authorizationContext) {
          authorizations = authorizationContext.getScalaAuthorizations();
        }

        Option modelOption = toOption(toScalaModelMap(models));

        ArrayList sortedDescriptions = new ArrayList(apiDescriptions);
        Collections.sort(sortedDescriptions, this.apiDescriptionOrdering);

        String resourcePath = longestCommonPath(sortedDescriptions);
View Full Code Here

Examples of weka.core.Option

   * @param loader  the loader to create the option string for
   * @return    the option string
   */
  protected static String makeOptionStr(AbstractFileLoader loader) {
    StringBuffer   result;
    Option     option;
   
    result = new StringBuffer("\nUsage:\n");
    result.append("\t" + loader.getClass().getName().replaceAll(".*\\.", ""));
    if (loader instanceof OptionHandler)
      result.append(" [options]");
    result.append(" <");
    String[] ext = loader.getFileExtensions();
    for (int i = 0; i < ext.length; i++) {
  if (i > 0)
    result.append(" | ");
  result.append("file" + ext[i]);
    }
    result.append(">\n");

    if (loader instanceof OptionHandler) {
      result.append("\nOptions:\n\n");
      Enumeration enm = ((OptionHandler) loader).listOptions();
      while (enm.hasMoreElements()) {
  option = (Option) enm.nextElement();
  result.append(option.synopsis() + "\n");
  result.append(option.description() + "\n");
      }
    }
   
    return result.toString();
  }
View Full Code Here

Examples of weka.core.Option

   * @return an enumeration of all the available options.
   */
  public Enumeration listOptions() {
    Vector<Option> result = new Vector<Option>();
   
    result.add(new Option(
        "\tThe range of attributes to force type to be NOMINAL.\n"
        + "\t'first' and 'last' are accepted as well.\n"
        + "\tExamples: \"first-last\", \"1,4,5-27,50-last\"\n"
        + "\t(default: -none-)",
        "N", 1, "-N <range>"));
   
    result.add(new Option(
        "\tThe range of attribute to force type to be STRING.\n"
        + "\t'first' and 'last' are accepted as well.\n"
        + "\tExamples: \"first-last\", \"1,4,5-27,50-last\"\n"
        + "\t(default: -none-)",
        "S", 1, "-S <range>"));
   
    result.add(new Option(
        "\tThe range of attribute to force type to be DATE.\n"
        + "\t'first' and 'last' are accepted as well.\n"
        + "\tExamples: \"first-last\", \"1,4,5-27,50-last\"\n"
        + "\t(default: -none-)",
        "D", 1, "-D <range>"));
   
    result.add(new Option(
        "\tThe date formatting string to use to parse date values.\n"       
        + "\t(default: \"yyyy-MM-dd'T'HH:mm:ss\")",
        "format", 1, "-format <date format>"));
   
    result.add(new Option(
        "\tThe string representing a missing value.\n"
        + "\t(default: ?)",
        "M", 1, "-M <str>"));
   
    result.addElement(new Option(
        "\tThe field separator to be used.\n"
        + "\t'\\t' can be used as well.\n"
        + "\t(default: ',')",
        "F", 1, "-F <separator>"));
     
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.