Package org.apache.tapestry

Examples of org.apache.tapestry.OptionModel


    @Test
    public void map_entry_to_option_model()
    {
        Map<String, String> map = Collections.singletonMap("key", "value");
        Map.Entry entry = map.entrySet().iterator().next();
        OptionModel model = TapestryInternalUtils.toOptionModel(entry);

        assertEquals(model.getLabel(), "value");
        assertEquals(model.getValue(), "key");
    }
View Full Code Here


    @Test
    public void object_to_option_model()
    {
        Object object = new Integer(27);
        OptionModel model = TapestryInternalUtils.toOptionModel(object);

        assertEquals(model.getLabel(), "27");
        assertEquals(model.getValue(), object);
    }
View Full Code Here

    }

    @Test
    public void string_to_option_model_just_label()
    {
        OptionModel model = TapestryUtils.toOptionModel("Just A Label");

        assertEquals(model.getLabel(), "Just A Label");
        assertEquals(model.getValue(), "Just A Label");
    }
View Full Code Here

    }

    @Test
    public void string_to_option_model()
    {
        OptionModel model = TapestryUtils.toOptionModel("my-value=Some Label");

        assertEquals(model.getLabel(), "Some Label");
        assertEquals(model.getValue(), "my-value");
    }
View Full Code Here

            writeDisabled(writer, isDisabled());

            for (Object value : getSelected())
            {
                OptionModel model = _valueToOptionModel.get(value);

                _renderer.option(model);
            }

            writer.end();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.OptionModel

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.