01: /* *************************************************************************
02:
03: Millstone(TM)
04: Open Sourced User Interface Library for
05: Internet Development with Java
06:
07: Millstone is a registered trademark of IT Mill Ltd
08: Copyright (C) 2000-2005 IT Mill Ltd
09:
10: *************************************************************************
11:
12: This library is free software; you can redistribute it and/or
13: modify it under the terms of the GNU Lesser General Public
14: license version 2.1 as published by the Free Software Foundation.
15:
16: This library is distributed in the hope that it will be useful,
17: but WITHOUT ANY WARRANTY; without even the implied warranty of
18: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19: Lesser General Public License for more details.
20:
21: You should have received a copy of the GNU Lesser General Public
22: License along with this library; if not, write to the Free Software
23: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24:
25: *************************************************************************
26:
27: For more information, contact:
28:
29: IT Mill Ltd phone: +358 2 4802 7180
30: Ruukinkatu 2-4 fax: +358 2 4802 7181
31: 20540, Turku email: info@itmill.com
32: Finland company www: www.itmill.com
33:
34: Primary source for MillStone information and releases: www.millstone.org
35:
36: ********************************************************************** */
37:
38: package org.millstone.base.ui;
39:
40: import org.millstone.base.data.Container;
41: import org.millstone.base.data.Property;
42: import org.millstone.base.data.Item;
43:
44: /** Factory for creating new Field-instances based on type,
45: * datasource and/or context.
46: *
47: * @author IT Mill Ltd.
48: * @version 3.1.1
49: * @since 3.1
50: */
51: public interface FieldFactory {
52:
53: /** Creates field based on type of data.
54: *
55: *
56: * @param type The type of data presented in field
57: * @param uiContext The component where the field is presented.
58: * @return Field The field suitable for editing the specified data.
59: *
60: */
61: Field createField(Class type, Component uiContext);
62:
63: /** Creates field based on the property datasource.
64: *
65: * @param property The property datasource.
66: * @param uiContext The component where the field is presented.
67: * @return Field The field suitable for editing the specified data.
68: */
69: Field createField(Property property, Component uiContext);
70:
71: /** Creates field based on the item and property id.
72: *
73: * @param item The item where the property belongs to.
74: * @param propertyId Id of the property.
75: * @param uiContext The component where the field is presented.
76: * @return Field The field suitable for editing the specified data.
77: */
78: Field createField(Item item, Object propertyId, Component uiContext);
79:
80: /** Creates field based on the container item id and property id.
81: *
82: * @param container Container where the property belongs to.
83: * @param itemId The item Id.
84: * @param propertyId Id of the property.
85: * @param uiContext The component where the field is presented.
86: * @return Field The field suitable for editing the specified data.
87: */
88: Field createField(Container container, Object itemId,
89: Object propertyId, Component uiContext);
90:
91: }
|