<commit_before>package ua.com.fielden.platform.web.centre.api.resultset.impl;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import ua.com.fielden.platform.dom.DomElement;
import ua.com.fielden.platform.utils.Pair;
import ua.com.fielden.platform.web.centre.api.crit.impl.AbstractCriterionWidget;
import ua.com.fielden.platform.web.interfaces.IImportable;
import ua.com.fielden.platform.web.interfaces.IRenderable;

/**
 * The implementation for all result set columns (dom element).
 *
 * @author TG Team
 *
 */
public class PropertyColumnElement implements IRenderable, IImportable {
    //The minimal column width. It is used only when specified width is greater than minimal.
    private final int MIN_COLUMN_WIDTH = 48;

    private final String propertyName;
    private final Optional<String> underlyingPropertyName;
    private final Optional<String> tooltipProp;
    private final String widgetName;
    private final String widgetPath;
    private final Object propertyType;
    private final Pair<String, String> titleDesc;
    private final Optional<FunctionalActionElement> action;
    private final List<SummaryElement> summary;
    private boolean debug = false;
    private final int growFactor;

    public final int width;
    public final boolean isFlexible;

    /**
     * Creates {@link PropertyColumnElement} from <code>entityType</code> type and <code>propertyName</code> and the name&path of widget.
     *
     * @param criteriaType
     * @param propertyName
     */
    public PropertyColumnElement(final String propertyName, final String underlyingPropertyName, final int width, final int growFactor, final boolean isFlexible, final String tooltipProp, final Object propertyType, final Pair<String, String> titleDesc, final Optional<FunctionalActionElement> action) {
        this.widgetName = AbstractCriterionWidget.extractNameFrom("egi/tg-property-column");
        this.widgetPath = "egi/tg-property-column";
        this.propertyName = propertyName;
        this.underlyingPropertyName = Optional.ofNullable(underlyingPropertyName);
        this.tooltipProp = Optional.ofNullable(tooltipProp);
        this.width = width;
        this.growFactor = growFactor;
        this.isFlexible = isFlexible;
        this.propertyType = propertyType;
        this.titleDesc = titleDesc;
        this.action = action;
        this.summary = new ArrayList<SummaryElement>();
    }

    /**<commit_msg>Reduced the minimum widths for columns in EGI from 48px to 16px.<commit_after>package ua.com.fielden.platform.web.centre.api.resultset.impl;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import ua.com.fielden.platform.dom.DomElement;
import ua.com.fielden.platform.utils.Pair;
import ua.com.fielden.platform.web.centre.api.crit.impl.AbstractCriterionWidget;
import ua.com.fielden.platform.web.interfaces.IImportable;
import ua.com.fielden.platform.web.interfaces.IRenderable;

/**
 * The implementation for all result set columns (dom element).
 *
 * @author T<NAME>
 *
 */
public class PropertyColumnElement implements IRenderable, IImportable {
    //The minimal column width. It is used only when specified width is greater than minimal.
    private final int MIN_COLUMN_WIDTH = 16;

    private final String propertyName;
    private final Optional<String> underlyingPropertyName;
    private final Optional<String> tooltipProp;
    private final String widgetName;
    private final String widgetPath;
    private final Object propertyType;
    private final Pair<String, String> titleDesc;
    private final Optional<FunctionalActionElement> action;
    private final List<SummaryElement> summary;
    private boolean debug = false;
    private final int growFactor;

    public final int width;
    public final boolean isFlexible;

    /**
     * Creates {@link PropertyColumnElement} from <code>entityType</code> type and <code>propertyName</code> and the name&path of widget.
     *
     * @param criteriaType
     * @param propertyName
     */
    public PropertyColumnElement(final String propertyName, final String underlyingPropertyName, final int width, final int growFactor, final boolean isFlexible, final String tooltipProp, final Object propertyType, final Pair<String, String> titleDesc, final Optional<FunctionalActionElement> action) {
        this.widgetName = AbstractCriterionWidget.extractNameFrom("egi/tg-property-column");
        this.widgetPath = "egi/tg-property-column";
        this.propertyName = propertyName;
        this.underlyingPropertyName = Optional.ofNullable(underlyingPropertyName);
        this.tooltipProp = Optional.ofNullable(tooltipProp);
        this.width = width;
        this.growFactor = growFactor;
        this.isFlexible = isFlexible;
        this.propertyType = propertyType;
        this.titleDesc = titleDesc;
        this.action = action;
        this.summary = new ArrayList<>();
    }

    /**
{'fraction_non_alphanumeric': 0.08529586384326143, 'fraction_numerical': 0.001583217890362161, 'mean_word_length': 3.9452054794520546, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3529429', 'n_tokens_mistral': 1373, 'n_tokens_neox': 1352, 'n_words': 378}