Esempio n. 1
0
        /**
         * Returns the condition specification from the matcher, or <tt>null</tt> if
         * there is none.
         *
         * @param m The matcher for the format part.
         *
         * @return The condition specification or <tt>null</tt>.
         */
        private CellFormatCondition GetCondition(Match m)
        {
            String mdesc = m.Groups[(CONDITION_OPERATOR_GROUP)].Value;

            if (mdesc == null || mdesc.Length == 0)
            {
                return(null);
            }
            return(CellFormatCondition.GetInstance(m.Groups[(
                                                                CONDITION_OPERATOR_GROUP)].Value, m.Groups[(CONDITION_VALUE_GROUP)].Value));
        }
Esempio n. 2
0
        /**
         * Create an object to represent a format part.
         *
         * @param desc The string to Parse.
         */
        public CellFormatPart(String desc)
        {
            Match m = FORMAT_PAT.Match(desc);

            if (!m.Success)
            {
                throw new ArgumentException("Unrecognized format: " + "\"" + desc + "\"");
            }
            color     = GetColor(m);
            condition = GetCondition(m);
            type      = GetCellFormatType(m);
            format    = GetFormatter(m);
        }