Examples of LabelValue


Examples of org.appfuse.model.LabelValue

        for (int i = 0; i < available.length; i++) {
            final String iso = available[i].getCountry();
            final String name = available[i].getDisplayCountry(locale);

            if (!EMPTY.equals(iso) && !EMPTY.equals(name)) {
                LabelValue country = new LabelValue(name, iso);

                if (!countries.contains(country)) {
                    countries.add(new LabelValue(name, iso));
                }
            }
        }

        Collections.sort(countries, new LabelValueComparator(locale));
View Full Code Here

Examples of org.appfuse.model.LabelValue

         * @param o2 The second LabelValue to compare.
         *
         * @return The value returned by comparing the localized labels.
         */
        public final int compare(Object o1, Object o2) {
            LabelValue lhs = (LabelValue) o1;
            LabelValue rhs = (LabelValue) o2;

            return c.compare(lhs.getLabel(), rhs.getLabel());
        }
View Full Code Here

Examples of org.appfuse.model.LabelValue

    public List<LabelValue> getAllRoles() {
        List<Role> roles = dao.getRoles();
        List<LabelValue> list = new ArrayList<LabelValue>();

        for (Role role1 : roles) {
            list.add(new LabelValue(role1.getName(), role1.getName()));
        }

        return list;
    }
View Full Code Here

Examples of org.appfuse.model.LabelValue

        if (availableCountries == null) {
            final String EMPTY = "";
            final Locale[] available = Locale.getAvailableLocales();
   
            List<LabelValue> countries = new ArrayList<LabelValue>();
            countries.add(new LabelValue("",""));

            for (Locale anAvailable : available) {
                final String iso = anAvailable.getCountry();
                final String name = anAvailable.getDisplayCountry(locale);

                if (!EMPTY.equals(iso) && !EMPTY.equals(name)) {
                    LabelValue country = new LabelValue(name, iso);

                    if (!countries.contains(country)) {
                        countries.add(new LabelValue(name, iso));
                    }
                }
            }

            Collections.sort(countries, new LabelValueComparator(locale));
           
            Map<String, String> options = new LinkedHashMap<String, String>();
            // loop through and convert list to a JSF-Friendly Map for a <select>
            for (Object country : countries) {
                LabelValue option = (LabelValue) country;
                if (!options.containsValue(option.getValue())) {
                    options.put(option.getLabel(), option.getValue());
                }
            }
            this.availableCountries = options;
        }
View Full Code Here

Examples of org.appfuse.model.LabelValue

         * @param o2 The second LabelValue to compare.
         *
         * @return The value returned by comparing the localized labels.
         */
        public final int compare(Object o1, Object o2) {
            LabelValue lhs = (LabelValue) o1;
            LabelValue rhs = (LabelValue) o2;

            return c.compare(lhs.getLabel(), rhs.getLabel());
        }
View Full Code Here

Examples of org.cipres.treebase.web.model.LabelValue

    /*
     * submission drop down list
     */
    List submissionTypes = new ArrayList();
    submissionTypes.add(new LabelValue("In Progress", Constants.SUBMISSION_INPROGRESS));
    submissionTypes.add(new LabelValue("Submitted", Constants.SUBMISSION_SUBMITTED));
    submissionTypes.add(new LabelValue("Published", Constants.SUBMISSION_PUBLISHED));
    context.setAttribute(Constants.SUBMISSION_TYPES, submissionTypes);

    /*
     * algorithm drop down list
     */
 
View Full Code Here

Examples of org.cipres.treebase.web.model.LabelValue

      "analysis_step_id",
      null);

    AnalysisStep analysisStep = mAnalysisStepService.findByID(Long.parseLong(analysis_step_id));
    // add it to the drop down list
    steps.add(new LabelValue(analysisStep.getDisplayName(), analysis_step_id));
    dataMap.put("steps", steps);

    // determine input/output type
    List<LabelValue> inputOutputTypes = new ArrayList<LabelValue>();
    inputOutputTypes.add(new LabelValue("Input", Constants.INPUT_KEY));
    inputOutputTypes.add(new LabelValue("Output", Constants.OUTPUT_KEY));
    dataMap.put("inputOutputTypes", inputOutputTypes);

    // determine tree/matrix type
    List<LabelValue> dataTypes = new ArrayList<LabelValue>();
    dataTypes.add(new LabelValue("Matrix", Constants.MATRIX_KEY));
    dataTypes.add(new LabelValue("Tree", Constants.TREE_KEY));
    dataTypes.add(new LabelValue("Tree Block", Constants.TREE_LIST));
    dataMap.put("dataTypes", dataTypes);

    return dataMap;
  }
View Full Code Here

Examples of org.cipres.treebase.web.model.LabelValue

  protected Map referenceData(HttpServletRequest request) {

    Map criteriaMap = new HashMap();

    List categories = new ArrayList();
    categories.add(new LabelValue(Constants.SEARCH_STUDY, Constants.SEARCH_STUDY));
    categories.add(new LabelValue(Constants.SEARCH_MATRIX, Constants.SEARCH_MATRIX));
    categories.add(new LabelValue(Constants.SEARCH_TREE, Constants.SEARCH_TREE));
    criteriaMap.put("categories", categories);

    List attributes = new ArrayList();
    attributes.add(new LabelValue(Constants.SEARCH_AUTHOR, Constants.SEARCH_AUTHOR));
    attributes.add(new LabelValue(
      Constants.SEARCH_CITATION_TITLE,
      Constants.SEARCH_CITATION_TITLE));
    attributes.add(new LabelValue(Constants.SEARCH_SOFTWARE, Constants.SEARCH_SOFTWARE));
    attributes.add(new LabelValue(Constants.SEARCH_ALGORITHM, Constants.SEARCH_ALGORITHM));
    Collections.sort(attributes, LabelValue.CASE_INSENSITIVE_ORDER);
    criteriaMap.put("attributes", attributes);

    List matches = new ArrayList();
    matches.add(new LabelValue("Equals", "Equals"));
    matches.add(new LabelValue("Contains", "Contains"));
    criteriaMap.put("matches", matches);

    return criteriaMap;
  }
View Full Code Here

Examples of org.itnaf.model.LabelValue

   
    public static Map convertListToMap(List list) {
        Map map = new LinkedHashMap();
       
        for (Iterator it = list.iterator(); it.hasNext();) {
            LabelValue option = (LabelValue) it.next();
            map.put(option.getLabel(), option.getValue());
        }
       
        return map;
    }
View Full Code Here

Examples of org.itnaf.model.LabelValue

        List list = new ArrayList();
        Role role = null;

        for (int i = 0; i < roles.size(); i++) {
            role = (Role) roles.get(i);
            list.add(new LabelValue(role.getName(), role.getName()));
        }

        return list;
    }
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.