Package org.springframework.util.comparator

Examples of org.springframework.util.comparator.CompoundComparator


    Collection enumValues = getEnumResolver().getLabeledEnumSet(enumType);
    if (logger.isDebugEnabled()) {
      logger.debug("Populating combo box model with enums of type '" + enumType.getName() + "'; enums are ["
          + enumValues + "]");
    }
    CompoundComparator comparator = new CompoundComparator();
    comparator.addComparator(LabeledEnum.LABEL_ORDER);
    comparator.addComparator(new ComparableComparator());
    comboBox.setModel(new ComboBoxListModel(new ArrayList(enumValues), comparator));
    comboBox.setRenderer(new LabeledEnumListRenderer(messageSource));
    comboBox.setEditor(new LabeledEnumComboBoxEditor(messageSource, comboBox.getEditor()));
  }
View Full Code Here


    }

    protected void doBindControl(ListModel bindingModel) {
        setRenderer(new LabeledEnumListRenderer(getMessageSource()));
        setEditor(new LabeledEnumComboBoxEditor(getMessageSource(), getEditor()));
        CompoundComparator comparator = new CompoundComparator();
        comparator.addComparator(LabeledEnum.LABEL_ORDER);
        comparator.addComparator(new ComparableComparator());
        setComparator(comparator);
        super.doBindControl(bindingModel);
    }
View Full Code Here

TOP

Related Classes of org.springframework.util.comparator.CompoundComparator

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.