/*
 * Copyright (c) 2008-2013 Haulmont. All rights reserved.
 * Use is subject to license terms, see http://www.cuba-platform.com/license for details.
 */
package com.haulmont.cuba.gui.xml.layout.loaders;

import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.components.TextInputField;
import com.haulmont.cuba.gui.xml.layout.ComponentsFactory;
import com.haulmont.cuba.gui.xml.layout.LayoutLoaderConfig;
import org.apache.commons.lang.StringUtils;
import org.dom4j.Element;

/**
 * @author abramov
 * @version $Id$
 */
public abstract class AbstractTextFieldLoader extends AbstractFieldLoader {

    public AbstractTextFieldLoader(Context context, LayoutLoaderConfig config, ComponentsFactory factory) {
        super(context, config, factory);
    }

    @Override
    public Component loadComponent(ComponentsFactory factory, Element element, Component parent) {
        final TextInputField component = (TextInputField) super.loadComponent(factory, element, parent);

        loadStyleName(component, element);

        return component;
    }

    protected void loadTrimming(Element element, TextInputField.TrimSupported component) {
        String trim = element.attributeValue("trim");
        if (!StringUtils.isEmpty(trim)) {
            component.setTrimming(Boolean.valueOf(trim));
        }
    }

    protected void loadMaxLength(Element element, TextInputField.MaxLengthLimited component) {
        final String maxLength = element.attributeValue("maxLength");
        if (!StringUtils.isEmpty(maxLength)) {
            component.setMaxLength(Integer.valueOf(maxLength));
        }
    }
}
@@ -209,60 +209,8 @@
 %0D%0A%0D%0A
-import com.haulmont.cuba.gui.components.Component;%0D%0A
 impo
@@ -748,313 +748,8 @@
 %0D%0A%0D%0A
-    @Override%0D%0A    public Component loadComponent(ComponentsFactory factory, Element element, Component parent) %7B%0D%0A        final TextInputField component = (TextInputField) super.loadComponent(factory, element, parent);%0D%0A%0D%0A        loadStyleName(component, element);%0D%0A%0D%0A        return component;%0D%0A    %7D%0D%0A%0D%0A
     

Remove dublicated loadStyleName from AbstractTextFieldLoader #PL-2733