001: /*
002: ItsNat Java Web Application Framework
003: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
004: Author: Jose Maria Arranz Santamaria
005:
006: This program is free software: you can redistribute it and/or modify
007: it under the terms of the GNU Affero General Public License as published by
008: the Free Software Foundation, either version 3 of the License, or
009: (at your option) any later version. See the GNU Affero General Public
010: License for more details. See the copy of the GNU Affero General Public License
011: included in this program. If not, see <http://www.gnu.org/licenses/>.
012: */
013:
014: package org.itsnat.comp;
015:
016: import org.itsnat.comp.ItsNatFormattedTextField.ItsNatFormatter;
017: import org.itsnat.comp.ItsNatFormattedTextField.ItsNatFormatterFactory;
018:
019: /**
020: * Defines a factory with several specialized formatters.
021: *
022: * @author Jose Maria Arranz Santamaria
023: * @see #getItsNatFormatter(ItsNatFormattedTextField)
024: * @see ItsNatFormattedTextField#createDefaultItsNatFormatterFactory()
025: */
026: public interface ItsNatFormatterFactoryDefault extends
027: ItsNatFormatterFactory {
028: /**
029: * Returns the ItsNat formatter to use if the component value
030: * ({@link ItsNatFormattedTextField#getValue()}) is null.
031: *
032: * @return the formatter to use when the component value is null.
033: * @see #setNullFormatter(ItsNatFormattedTextField.ItsNatFormatter)
034: */
035: public ItsNatFormatter getNullFormatter();
036:
037: /**
038: * Sets the ItsNat formatter to use if the component value
039: * ({@link ItsNatFormattedTextField#getValue()}) is null.
040: *
041: * @param atf the ItsNat formatter.
042: * @see #getNullFormatter()
043: */
044: public void setNullFormatter(ItsNatFormatter atf);
045:
046: /**
047: * Returns the ItsNat formatter to use if the {@link ItsNatFormattedTextField}
048: * is not being edited ({@link ItsNatComponent#hasFocus()} returns false)
049: * and either the value is not-null, or the value is null and a null formatter has not been specified.
050: *
051: * @return the formatter to use in display mode.
052: * @see #setDisplayFormatter(ItsNatFormattedTextField.ItsNatFormatter)
053: * @see #getNullFormatter()
054: */
055: public ItsNatFormatter getDisplayFormatter();
056:
057: /**
058: * Sets the ItsNat formatter to use if the component
059: * is not being edited and either the value is not null,
060: * or the value is null and a null formatter has has not been specified.
061: *
062: * @param atf the formatter to use in display mode.
063: * @see #getDisplayFormatter()
064: */
065: public void setDisplayFormatter(ItsNatFormatter atf);
066:
067: /**
068: * Returns the ItsNat formatter to use if the {@link ItsNatFormattedTextField}
069: * is being edited ({@link ItsNatComponent#hasFocus()} returns true)
070: * and either the value is not-null, or the value is null and a null formatter has has not been specified.
071: *
072: * @return the formatter to use in edition mode.
073: * @see #setEditFormatter(ItsNatFormattedTextField.ItsNatFormatter)
074: * @see #getNullFormatter()
075: */
076: public ItsNatFormatter getEditFormatter();
077:
078: /**
079: * Sets the ItsNat formatter to use if the component
080: * is being edited and either the value is not-null,
081: * or the value is null and a null formatter has has not been specified.
082: *
083: * @param atf the formatter to use in edition mode.
084: * @see #getEditFormatter()
085: */
086: public void setEditFormatter(ItsNatFormatter atf);
087:
088: /**
089: * Returns the ItsNat formatter to use
090: * as a last resort, eg in case a display, edit or null
091: * formatter has not been specified.
092: *
093: * @return the formatter to use if a more specific one is not specified.
094: * @see #setDefaultFormatter(ItsNatFormattedTextField.ItsNatFormatter)
095: * @see #getNullFormatter()
096: * @see #getDisplayFormatter()
097: * @see #getEditFormatter()
098: */
099: public ItsNatFormatter getDefaultFormatter();
100:
101: /**
102: * Sets the ItsNat formatter to use
103: * as a last resort, eg in case a display, edit or null
104: * formatter has not been specified.
105: *
106: * @param atf the formatter to use if a more specific one is not specified.
107: * @see #getDefaultFormatter()
108: */
109: public void setDefaultFormatter(ItsNatFormatter atf);
110:
111: }
|