Search in sources :

Example 1 with MultiTextPreferenceInput

use of org.apereo.portal.portletpublishing.xml.MultiTextPreferenceInput in project uPortal by Jasig.

the class PreferenceInputFactory method createMultiTextPreference.

/**
     * Create a multi-valued text input preference.
     *
     * @param name
     * @param label
     * @param displayType
     * @param defaultValues
     * @return
     */
public static Preference createMultiTextPreference(String name, String label, TextDisplay displayType, List<String> defaultValues) {
    MultiTextPreferenceInput input = new MultiTextPreferenceInput();
    input.getDefaults().addAll(defaultValues);
    input.setDisplay(displayType);
    Preference pref = new Preference();
    pref.setName(name);
    pref.setLabel(label);
    pref.setPreferenceInput(new JAXBElement<MultiTextPreferenceInput>(new QName("multi-text-parameter-input"), MultiTextPreferenceInput.class, input));
    return pref;
}
Also used : Preference(org.apereo.portal.portletpublishing.xml.Preference) QName(javax.xml.namespace.QName) MultiTextPreferenceInput(org.apereo.portal.portletpublishing.xml.MultiTextPreferenceInput)

Aggregations

QName (javax.xml.namespace.QName)1 MultiTextPreferenceInput (org.apereo.portal.portletpublishing.xml.MultiTextPreferenceInput)1 Preference (org.apereo.portal.portletpublishing.xml.Preference)1