GuideTermsAndConditions.java 2.49 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  org.apache.sling.api.resource.ValueMap
 */
package com.adobe.aemds.guide.common;

import com.adobe.aemds.guide.common.GuideField;
import java.util.Arrays;
import java.util.List;
import org.apache.sling.api.resource.ValueMap;

/*
 * This class specifies class file version 49.0 but uses Java 6 signatures.  Assumed Java 6.
 */
public class GuideTermsAndConditions
extends GuideField {
    @Override
    public String getStyles() {
        String style = super.getStyles();
        style = style + (this.getHeight().length() > 0 ? "max-height:none;" : "");
        return style;
    }

    public String getTncTextContent() {
        return this.externalize((String)this.resourceProps.get("tncTextContent", String.class));
    }

    public List<String> getLinkText() {
        String[] arr = (String[])this.resourceProps.get("linkText", (Object)new String[0]);
        return Arrays.asList(arr);
    }

    public Boolean getShowLink() {
        return (Boolean)this.resourceProps.get("showLink", Boolean.class);
    }

    public Boolean getShowApprovalOption() {
        Boolean showAsPopUp = this.getShowAsPopUp();
        return showAsPopUp != false || (Boolean)this.resourceProps.get("showApprovalOption", (Object)false) != false;
    }

    public Boolean getShowAsPopUp() {
        return (Boolean)this.resourceProps.get("showAsPopUp", (Object)false);
    }

    public String getTncCheckBoxContent() {
        return this.externalize((String)this.resourceProps.get("tncCheckBoxContent", String.class));
    }

    public String getAssistProperty() {
        return this.externalize((String)this.resourceProps.get("assistPriority", String.class));
    }

    public String getScreenReaderText() {
        String screenReaderText = null;
        String assistPriority = this.getAssistProperty();
        if (assistPriority != null) {
            String customText;
            if ("label".equals(assistPriority)) {
                String title = (String)this.resourceProps.get("jcr:title", String.class);
                if (title != null) {
                    screenReaderText = title;
                }
            } else if ("custom".equals(assistPriority) && (customText = (String)this.resourceProps.get("custom", String.class)) != null) {
                screenReaderText = customText;
            }
        }
        return this.externalize(screenReaderText);
    }

    public String getGuideFieldType() {
        return "guideTermsAndConditions";
    }
}