Package org.apache.tapestry

Examples of org.apache.tapestry.OptionGroupModel


    }

    @Test
    public void option_groups() throws Exception
    {
        OptionGroupModel husbands = new OptionGroupModelImpl("Husbands", false,
                TapestryInternalUtils.toOptionModels("Fred,Barney"));
        OptionGroupModel wives = new OptionGroupModelImpl("Wives", true, TapestryInternalUtils
                .toOptionModels("Wilma,Betty"));
        List<OptionGroupModel> groupModels = CollectionFactory.newList(husbands, wives);

        Select select = new Select();
View Full Code Here


    }

    @Test
    public void option_groups_precede_ungroup_options() throws Exception
    {
        OptionGroupModel husbands = new OptionGroupModelImpl("Husbands", false,
                TapestryInternalUtils.toOptionModels("Fred,Barney"));

        Select select = new Select();

        select.setModel(new SelectModelImpl(Collections.singletonList(husbands),
View Full Code Here

    @Test
    public void option_group_attributes() throws Exception
    {
        Map<String, String> attributes = Collections.singletonMap("class", "pixie");

        OptionGroupModel husbands = new OptionGroupModelImpl("Husbands", false,
                TapestryInternalUtils.toOptionModels("Fred,Barney"), attributes);

        Select select = new Select();

        select.setModel(new SelectModelImpl(Collections.singletonList(husbands), null));
View Full Code Here

    }

    @Test
    public void option_groups() throws Exception
    {
        OptionGroupModel husbands = new OptionGroupModelImpl("Husbands", false, TapestryUtils
                .toOptionModels("Fred,Barney"));
        OptionGroupModel wives = new OptionGroupModelImpl("Wives", true, TapestryUtils
                .toOptionModels("Wilma,Betty"));
        List<OptionGroupModel> groupModels = CollectionFactory.newList(husbands, wives);

        Select select = new Select();
View Full Code Here

    }

    @Test
    public void option_groups_precede_ungroup_options() throws Exception
    {
        OptionGroupModel husbands = new OptionGroupModelImpl("Husbands", false, TapestryUtils
                .toOptionModels("Fred,Barney"));

        Select select = new Select();

        select.setModel(new SelectModelImpl(Collections.singletonList(husbands), TapestryUtils
View Full Code Here

    @Test
    public void option_group_attributes() throws Exception
    {
        Map<String, String> attributes = Collections.singletonMap("class", "pixie");

        OptionGroupModel husbands = new OptionGroupModelImpl("Husbands", false, TapestryUtils
                .toOptionModels("Fred,Barney"), attributes);

        Select select = new Select();

        select.setModel(new SelectModelImpl(Collections.singletonList(husbands), null));
View Full Code Here

    @Test
    public void basics()
    {
        List<OptionModel> options = Collections.emptyList();

        OptionGroupModel group = new OptionGroupModelImpl("Label", true, options);

        assertEquals(group.toString(), "OptionGroupModel[Label]");
        assertTrue(group.isDisabled());
        assertNull(group.getAttributes());
        assertSame(group.getOptions(), options);
    }
View Full Code Here

    public void map_contructor_retains_map()
    {
        List<OptionModel> options = Collections.emptyList();
        Map<String, String> attributes = Collections.emptyMap();

        OptionGroupModel group = new OptionGroupModelImpl("Label", true, options, attributes);

        assertSame(group.getAttributes(), attributes);
    }
View Full Code Here

    @Test
    public void strings_contructor_builds_map()
    {
        List<OptionModel> options = Collections.emptyList();

        OptionGroupModel group = new OptionGroupModelImpl("Label", true, options, "fred",
                                                          "flintstone", "barney", "rubble");

        Map<String, String> attributes = group.getAttributes();

        assertEquals(attributes.size(), 2);
        assertEquals(attributes.get("fred"), "flintstone");
        assertEquals(attributes.get("barney"), "rubble");
    }
View Full Code Here

    }

    @Test
    public void option_groups() throws Exception
    {
        OptionGroupModel husbands = new OptionGroupModelImpl("Husbands", false, TapestryInternalUtils
                .toOptionModels("Fred,Barney"));
        OptionGroupModel wives = new OptionGroupModelImpl("Wives", true, TapestryInternalUtils
                .toOptionModels("Wilma,Betty"));
        List<OptionGroupModel> groupModels = CollectionFactory.newList(husbands, wives);

        Select select = new Select();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.OptionGroupModel

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.