Beispiel #1
0
        /**
         * Apply this format part to the given value.  This returns a {@link
         * CellFormatResult} object with the results.
         *
         * @param value The value to apply this format part to.
         *
         * @return A {@link CellFormatResult} object Containing the results of
         *         Applying the format to the value.
         */
        public CellFormatResult Apply(Object value)
        {
            bool   applies = Applies(value);
            String text;

            if (applies)
            {
                text = format.Format(value);
            }
            else
            {
                text = format.SimpleFormat(value);
            }
            return(new CellFormatResult(applies, text));
        }
        /**
         * Apply this format part to the given value.  This returns a {@link
         * CellFormatResult} object with the results.
         *
         * @param value The value to apply this format part to.
         *
         * @return A {@link CellFormatResult} object Containing the results of
         *         Applying the format to the value.
         */
        public CellFormatResult Apply(Object value)
        {
            bool   applies = Applies(value);
            String text;
            Color  textColor;

            if (applies)
            {
                text      = format.Format(value);
                textColor = color;
            }
            else
            {
                text      = format.SimpleFormat(value);
                textColor = Color.Empty;
            }
            return(new CellFormatResult(applies, text, textColor));
        }