Package org.springframework.util.comparator

Examples of org.springframework.util.comparator.ComparableComparator


        } catch (IllegalArgumentException iae) {
            // expected
        }

        try {
            createBetweenCondition(null, new Integer(3), new ComparableComparator());
            fail("An IllegalArgumentException must be thrown if the condition is initialized with a null lower bound");
        } catch (IllegalArgumentException iae) {
            // expected
        }
    }
View Full Code Here


        } catch (IllegalArgumentException iae) {
            // expected
        }

        try {
            createBetweenCondition(new Integer(3), null, new ComparableComparator());
            fail("An IllegalArgumentException must be thrown if the condition is initialized with a null upper bound");
        } catch (IllegalArgumentException iae) {
            // expected
        }
    }
View Full Code Here

        } catch (IllegalArgumentException iae) {
            // expected
        }

        try {
            createCondition(null, new ComparableComparator());
            fail("An IllegalArgumentException must be thrown if the condition is initialized with a null bound");
        } catch (IllegalArgumentException iae) {
            // expected
        }
    }
View Full Code Here

      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

    }

    public void testComparator() {
        ComboBoxBinder binder = new ComboBoxBinder();
        binder.setSelectableItems(new Object[] { "2", "4", "1", "2", "3" });
        binder.setComparator(new ComparableComparator());
        ComboBoxBinding binding = (ComboBoxBinding) binder.bind(fm, "simpleProperty", Collections.EMPTY_MAP);
        ListModel bindingModel = binding.getBindingModel();
        assertEquals(5, bindingModel.getSize());
        assertEquals("1", bindingModel.getElementAt(0));
        assertEquals("2", bindingModel.getElementAt(1));
View Full Code Here

TOP

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

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.