Search in sources :

Example 1 with SingleTextPreferenceInput

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

the class PreferenceInputFactory method createSingleTextPreference.

/**
 * Craete a single-valued text input preference.
 *
 * @param name
 * @param label
 * @param displayType
 * @param defaultValue
 * @return
 */
public static Preference createSingleTextPreference(String name, String label, TextDisplay displayType, String defaultValue) {
    SingleTextPreferenceInput input = new SingleTextPreferenceInput();
    input.setDefault(defaultValue);
    input.setDisplay(displayType);
    Preference pref = new Preference();
    pref.setName(name);
    pref.setLabel(label);
    pref.setPreferenceInput(new JAXBElement<SingleTextPreferenceInput>(new QName("single-text-parameter-input"), SingleTextPreferenceInput.class, input));
    return pref;
}
Also used : Preference(org.apereo.portal.portletpublishing.xml.Preference) QName(javax.xml.namespace.QName) SingleTextPreferenceInput(org.apereo.portal.portletpublishing.xml.SingleTextPreferenceInput)

Aggregations

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