/*
 * Copyright (c) 2013 Haulmont Technology Ltd. All Rights Reserved.
 * Haulmont Technology proprietary and confidential.
 * Use is subject to license terms.
 */

package com.haulmont.cuba.gui.components;

import com.haulmont.chile.core.datatypes.impl.EnumClass;

/**
 * @author devyatkin
 * @version $Id$
 */
public interface MaskedField extends TextField {

    public enum ValueMode implements EnumClass<String> {

        MASKED("masked"),
        CLEAR("clear");

        private String id;

        ValueMode(String id) {
            this.id = id;
        }

        public String getId() {
            return id;
        }

        public static ValueMode fromId(String id) {
            for (ValueMode mode : ValueMode.values()) {
                if (mode.getId().equals(id)) {
                    return mode;
                }
            }
            return null;
        }
    }

    String NAME = "maskedField";

    void setMask(String mask);
    String getMask();

    void setValueMode(ValueMode mode);
    ValueMode getValueMode();
}
@@ -274,16 +274,400 @@
 %0A%0D%0A/**%0D%0A
+ * Masked field component generic interface.%0D%0A * Field supports following format symbols:%0D%0A * %3Cul%3E%0D%0A * %3Cli%3E# - Digit%3C/li%3E%0D%0A * %3Cli%3EU - Uppercase letter%3C/li%3E%0D%0A * %3Cli%3EL - Lowercase letter%3C/li%3E%0D%0A * %3Cli%3EA - Letter or digit%3C/li%3E%0D%0A * %3Cli%3E* - Any symbol%3C/li%3E%0D%0A * %3Cli%3EH - Hex symbol%3C/li%3E%0D%0A * %3Cli%3E~ - + or -%3C/li%3E%0D%0A * %3C/ul%3E%0D%0A * Any other symbols in format will be treated as mask literals.%0D%0A *%0D%0A
  * @auth
@@ -1402,24 +1402,224 @@
 tMask();%0D%0A%0D%0A
+    /**%0D%0A     * Sets ValueMode for component%0D%0A     * %3Cp%3E%0D%0A     * MASKED - value contain mask literals%0D%0A     * CLEAR - value contain only user input.%0D%0A     * %3C/p%3E%0D%0A     *%0D%0A     * @param mode%0D%0A     */%0D%0A
     void set
@@ -1642,24 +1642,26 @@
 ode mode);%0D%0A
+%0D%0A
     ValueMod

Add javadoc to MaskedField interface #PL-2069