All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.citytechinc.cq.component.touchuidialog.container.Container Maven / Gradle / Ivy

There is a newer version: 7.0.0
Show newest version
package com.citytechinc.cq.component.touchuidialog.container;

import com.citytechinc.cq.component.touchuidialog.AbstractTouchUIDialogElement;
import com.citytechinc.cq.component.util.Constants;
import com.citytechinc.cq.component.xml.NameSpacedAttribute;
import org.codehaus.plexus.util.StringUtils;

public class Container extends AbstractTouchUIDialogElement {

    public static final String RESOURCE_TYPE = "granite/ui/components/foundation/container";

    public static final String RESOURCE_TYPE_CORAL3 = "granite/ui/components/coral/foundation/container";

    public static final String PRIMARY_TYPE = "nt:unstructured";

    private final boolean margin;

    private final boolean maximized;

    private NameSpacedAttribute title;

    private final NameSpacedAttribute showOnCreate;

    private final NameSpacedAttribute hideOnEdit;

    private NameSpacedAttribute orderBefore;

    public Container(ContainerParameters parameters) {
        super(parameters);

        margin = parameters.isMargin();
        maximized = parameters.isMaximized();

        if (StringUtils.isNotEmpty(parameters.getTitle())) {
            title = new NameSpacedAttribute(Constants.JCR_NS_URI, Constants.JCR_NS_PREFIX,
                parameters.getTitle());
        }

        showOnCreate =
            new NameSpacedAttribute(Constants.CQ_NS_URI, Constants.CQ_NS_PREFIX, parameters.isShowOnCreate());

        hideOnEdit =
            new NameSpacedAttribute(Constants.CQ_NS_URI, Constants.CQ_NS_PREFIX, parameters.isHideOnEdit());

        if (StringUtils.isNotEmpty(parameters.getOrderBefore())) {
            orderBefore = new NameSpacedAttribute(Constants.SLING_NS_PREFIX, Constants.SLING_NS_PREFIX,
                parameters.getOrderBefore());
        }
    }

    public boolean isMargin() {
        return margin;
    }

    public boolean isMaximized() {
        return maximized;
    }

    public NameSpacedAttribute getTitle() {
        return title;
    }

    public NameSpacedAttribute getShowOnCreate() {
        return showOnCreate;
    }

    public NameSpacedAttribute getHideOnEdit() {
        return hideOnEdit;
    }

    public NameSpacedAttribute getOrderBefore() {
        return orderBefore;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy