Package org.internna.iwebmvc.model.core

Examples of org.internna.iwebmvc.model.core.Color


    @Override
    public void initialize(ContextHolder context) {
        name = new I18nText();
        name.initialize(context);
        color = new Color();
    }
View Full Code Here


*/
public class ColorBinder extends PropertyEditorSupport {

    @Override
    public void setAsText(String text) throws IllegalArgumentException {
        Color c = (Color) getValue();
        if (StringUtils.hasText(text)) {
            List<String> colors = StringUtils.splitBetweenDelimiters(text, ";", ";");
            if ((colors == null) || (colors.size() != 3) || (!StringUtils.hasText(colors.get(0)))) throw new IllegalArgumentException("[" + text + "] cannot be converted to Color");
            if (c == null) c = new Color();
            c.setRed(Integer.parseInt(colors.get(0)));
            c.setGreen(Integer.parseInt(colors.get(1)));
            c.setBlue(Integer.parseInt(colors.get(2)));
        }
        setValue(c);
    }
View Full Code Here

        Locale en = new Locale("en", "English");
        managerImpl.dao.create(en);
        Locale es = new Locale("es", "Spanish");
        managerImpl.dao.create(es);
        Classification c = new Classification();
        c.setColor(new Color());
        c.getColor().setRed(100);c.getColor().setGreen(100);c.getColor().setBlue(20);
        c.setLetter("A");
        c.setNumber(1);
        c.setName(new I18nText());
        c.getName().setKey("key.1");
        c.getName().setValues(new ArrayList<LocalizedValue>(2));
        c.getName().getValues().add(new LocalizedValue());
        c.getName().getValues().get(0).setLocale(en);
        c.getName().getValues().get(0).setLocalizedValue("one");
        c.getName().getValues().add(new LocalizedValue());
        c.getName().getValues().get(1).setLocale(es);
        c.getName().getValues().get(1).setLocalizedValue("uno");
        managerImpl.dao.create(c);
        Classification c2 = new Classification();
        c2.setColor(new Color());
        c2.getColor().setRed(20);c2.getColor().setGreen(100);c2.getColor().setBlue(100);
        c2.setLetter("B");
        c2.setNumber(2);
        c2.setName(new I18nText());
        c2.getName().setKey("key.2");
View Full Code Here

TOP

Related Classes of org.internna.iwebmvc.model.core.Color

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.