01: /*
02: * Copyright (c) 2004 JETA Software, Inc. All rights reserved.
03: *
04: * Redistribution and use in source and binary forms, with or without modification,
05: * are permitted provided that the following conditions are met:
06: *
07: * o Redistributions of source code must retain the above copyright notice,
08: * this list of conditions and the following disclaimer.
09: *
10: * o Redistributions in binary form must reproduce the above copyright notice,
11: * this list of conditions and the following disclaimer in the documentation
12: * and/or other materials provided with the distribution.
13: *
14: * o Neither the name of JETA Software nor the names of its contributors may
15: * be used to endorse or promote products derived from this software without
16: * specific prior written permission.
17: *
18: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21: * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22: * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23: * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24: * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25: * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26: * INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28: */
29:
30: package com.jeta.forms.gui.components;
31:
32: import com.jeta.forms.gui.common.FormException;
33: import com.jeta.forms.gui.form.GridComponent;
34: import com.jeta.forms.gui.form.GridView;
35:
36: /**
37: * A <code>ComponentFactory</code> is responsible for creating GridComponent
38: * objects for a GridView. A GridComponent is a container for a JETABean and
39: * maintains information such as grid cell location and col/row span. There are
40: * several types of GridComponents. For example, there is a GridComponent for
41: * handling standard Swing components. There is also a GridComponent for
42: * handling nested forms. Each type has different initialization requirements.
43: * This is especially true during design mode when event listerners are
44: * installed on the GridComponents. See:
45: * {@link com.jeta.forms.gui.form.GridComponent }
46: *
47: * @author Jeff Tassin
48: */
49: public interface ComponentFactory {
50: /**
51: * Creates a GridComponent instances with the given name and the given
52: * parent view. However, the GridComponent is not added to the view in this
53: * call.
54: *
55: * @param compName
56: * the name of the component.
57: * @param parentView
58: * the parent view for the new grid component. This value is
59: * needed mainly for installing event listeners to the
60: * GridComponent in design mode.
61: */
62: public GridComponent createComponent(String compName,
63: GridView parentView) throws FormException;
64:
65: /**
66: * Returns the current component source object.
67: *
68: * @return the current component source.
69: */
70: ComponentSource getComponentSource();
71:
72: /**
73: * Sets the component source object associated with this factory.
74: *
75: * @param compsrc
76: * the current component source to associate with this factory.
77: */
78: void setComponentSource(ComponentSource compsrc);
79: }
|