Package org.jbpm.formapi.common.panels

Examples of org.jbpm.formapi.common.panels.ListWidget


    }


    @Override
    public Widget cloneDisplay(Map<String, Object> formData) {
        ListWidget lw = new ListWidget();
        populate(lw);
        Object value = getInputValue(formData);
        if (value != null) {
            if (value.getClass().isArray()) {
                Object[] arr = (Object[]) value;
                for (Object obj : arr) {
                    lw.addItem(String.valueOf(obj));
                }
            } else if (value instanceof Collection) {
                Collection<?> coll = (Collection<?>) value;
                for (Object obj : coll) {
                    lw.addItem(String.valueOf(obj));
                }
            } else if (value instanceof Map) {
                Map<?,?> map = (Map<?,?>) value;
                for (Object obj : map.values()) {
                    lw.addItem(String.valueOf(obj));
                }
            }
        } else {
            String locale = (String) formData.get(FormBuilderGlobals.BASE_LOCALE);
            if (locale == null) {
                for (String item : this.listWidget.getItems()) {
                    lw.addItem(item);
                }
            } else {
                String i18nText = getI18n(locale);
                if (i18nText != null && !"".equals(i18nText)) {
                    String[] items = i18nText.split(","); //TODO specify i18n items should be comma separated
                    if (items != null) {
                        for (String item : items) {
                            lw.addItem(item);
                        }
                    }
                }
            }
        }
        super.populateActions(lw.getElement());
        return lw;
    }
View Full Code Here

TOP

Related Classes of org.jbpm.formapi.common.panels.ListWidget

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.