GuideTableElement.java 1.53 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.adobe.aemds.guide.utils.TableUtils
 *  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.DoRTableElement;
import com.adobe.aemds.guide.addon.dor.elements.GuidePanelElement;
import com.adobe.aemds.guide.utils.TableUtils;
import com.adobe.xfa.Element;
import java.util.Properties;
import org.apache.sling.commons.json.JSONObject;

public class GuideTableElement
extends GuidePanelElement {
    public GuideTableElement(JSONObject jsonObject) {
        super(jsonObject);
        int columns = TableUtils.getColumnsCount((JSONObject)jsonObject);
        String property = "columns";
        String value = Integer.toString(columns);
        this.properties.put(property, value);
        property = "columnWidth";
        value = jsonObject.optString(property);
        if (value.split(",").length != columns) {
            value = "";
        }
        this.properties.put(property, value);
        property = "bindMatch";
        value = jsonObject.optString(property);
        if (value.equals("none")) {
            this.bindRef = null;
            this.properties.remove("bindRef");
            this.properties.put(property, value);
        }
    }

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