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

com.citytechinc.cq.component.editconfig.AbstractInPlaceEditorElement Maven / Gradle / Ivy

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

import com.citytechinc.cq.component.xml.AbstractXmlElement;
import com.citytechinc.cq.component.xml.XmlElement;
import org.codehaus.plexus.util.StringUtils;

import java.util.List;

public abstract class AbstractInPlaceEditorElement extends AbstractXmlElement implements InPlaceEditorElement {

    private final Boolean active;

    private final String editorType;

    private final String type;

    private final String title;

    private ConfigElement configElement;

    public AbstractInPlaceEditorElement(InPlaceEditorParameters parameters) {
        super(parameters);
        this.active = parameters.isActive();
        if (active != null) {
            this.editorType = parameters.getEditorType();
            this.type = null;
        } else {
            this.type = parameters.getEditorType();
            this.editorType = null;
        }
        this.title = StringUtils.isNotEmpty(parameters.getTitle()) ? parameters.getTitle() : parameters.getFieldName();
        this.configElement = parameters.getConfigElement();
    }

    public Boolean getActive() {
        return active;
    }

    public String getEditorType() {
        return editorType;
    }

    public String getType() {
        return type;
    }

    public String getTitle() {
        return title;
    }

    public ConfigElement getConfigElement() {
        return configElement;
    }

    public void setConfigElement(ConfigElement configElement) {
        this.configElement = configElement;
    }

    public void setContainedElements(List containedElements) {
        this.containedElements = containedElements;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy