001: /* *************************************************************************
002:
003: Millstone(TM)
004: Open Sourced User Interface Library for
005: Internet Development with Java
006:
007: Millstone is a registered trademark of IT Mill Ltd
008: Copyright (C) 2000-2005 IT Mill Ltd
009:
010: *************************************************************************
011:
012: This library is free software; you can redistribute it and/or
013: modify it under the terms of the GNU Lesser General Public
014: license version 2.1 as published by the Free Software Foundation.
015:
016: This library is distributed in the hope that it will be useful,
017: but WITHOUT ANY WARRANTY; without even the implied warranty of
018: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: Lesser General Public License for more details.
020:
021: You should have received a copy of the GNU Lesser General Public
022: License along with this library; if not, write to the Free Software
023: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024:
025: *************************************************************************
026:
027: For more information, contact:
028:
029: IT Mill Ltd phone: +358 2 4802 7180
030: Ruukinkatu 2-4 fax: +358 2 4802 7181
031: 20540, Turku email: info@itmill.com
032: Finland company www: www.itmill.com
033:
034: Primary source for MillStone information and releases: www.millstone.org
035:
036: ********************************************************************** */
037:
038: package org.millstone.base.ui;
039:
040: import org.millstone.base.data.BufferedValidatable;
041: import org.millstone.base.data.Property;
042: import org.millstone.base.ui.Component.Focusable;
043:
044: /**
045: * @author Sami Ekblad
046: *
047: */
048: public interface Field extends Component, BufferedValidatable,
049: Property, Property.ValueChangeNotifier,
050: Property.ValueChangeListener, Property.Editor, Focusable {
051:
052: void setCaption(String caption);
053:
054: String getDescription();
055:
056: void setDescription(String caption);
057:
058: /** Is this field required.
059: *
060: * Required fields must filled by the user.
061: *
062: * @return true if the
063: * @since 3.1
064: */
065: public boolean isRequired();
066:
067: /** Set the field required.
068: * Required fields must filled by the user.
069: *
070: * @param required Is the field required
071: * @since 3.1
072: */
073: public void setRequired(boolean required);
074:
075: /** An <code>Event</code> object specifying the Field whose value
076: * has been changed.
077: * @author IT Mill Ltd.
078: * @version 3.1.1
079: * @since 3.0
080: */
081: public class ValueChangeEvent extends Component.Event implements
082: Property.ValueChangeEvent {
083:
084: /**
085: * Serial generated by eclipse.
086: */
087: private static final long serialVersionUID = 3545803169444672816L;
088:
089: /** Constructs a new event object with the specified source
090: * field object.
091: *
092: * @param source the field that caused the event
093: */
094: public ValueChangeEvent(Field source) {
095: super (source);
096: }
097:
098: /** Gets the Property which triggered the event.
099: *
100: * @return Source Property of the event.
101: */
102: public Property getProperty() {
103: return (Property) getSource();
104: }
105: }
106: }
|