GuideTextBoxElement.java 1.18 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.adobe.xfa.Element
 *  org.apache.sling.commons.json.JSONObject
 */
package com.adobe.aemds.guide.addon.dor.elements;

import com.adobe.aemds.guide.addon.dor.elements.DoRElement;
import com.adobe.aemds.guide.addon.dor.elements.DoRTextBoxElement;
import com.adobe.aemds.guide.addon.dor.elements.GuideElement;
import com.adobe.aemds.guide.addon.dor.elements.GuideElementProperties;
import com.adobe.xfa.Element;
import java.util.Properties;
import org.apache.sling.commons.json.JSONObject;

public class GuideTextBoxElement
extends GuideElement {
    public GuideTextBoxElement(JSONObject jsonObject) {
        super(jsonObject);
        for (String key : GuideElementProperties.TEXTBOX_PROPERTIES) {
            if (!jsonObject.has(key)) continue;
            this.properties.put(key, jsonObject.optString(key));
        }
        if (jsonObject.has("allowRichText")) {
            this.properties.put("allowRichText", jsonObject.optString("allowRichText"));
        }
    }

    @Override
    public DoRElement createDoRElement(Element xfaElement) throws Exception {
        return new DoRTextBoxElement(xfaElement);
    }
}