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 java.awt.Container;
33:
34: import com.jeta.forms.gui.common.FormException;
35: import com.jeta.forms.gui.form.FormComponent;
36: import com.jeta.forms.store.memento.FormMemento;
37:
38: /**
39: * A factory for creating a form that is contained within a Swing container
40: * other than another FormComponent. For example, when a form is contained
41: * within a JTabbedPane or a JSplitPane, we use this factory to instantiate the
42: * form.
43: *
44: * @author Jeff Tassin
45: */
46: public interface ContainedFormFactory {
47: public static final String COMPONENT_ID = "contained.form.factory";
48:
49: /**
50: * Creates a form that is meant to be contained in a Swing container. This
51: * is form forms that can be edited in-place in the designer. This method
52: * actually creates two forms. The actual form that we can edit, and a top
53: * level parent that contains the form but is not directly editable.
54: *
55: * @return the top level parent form.
56: */
57: FormComponent createContainedForm(Class swingClass, FormMemento fm)
58: throws FormException;
59:
60: /**
61: * This method creates a top-level parent form that is used to contain a
62: * form that we can edit. This is used in two cases. In the first, we use a
63: * top level form in the FormEditor. In the second, we use the top-level
64: * form in contained forms (e.g. a form that is contained in a JTabbedPane
65: * tab ).
66: *
67: * @param parent
68: * the object that will contain the top-level parent
69: * @param compsrc
70: * the component source
71: * @param form
72: * the form that will be contained by the top-level parent
73: */
74: FormComponent createTopParent(Container parent,
75: ComponentSource compsrc, FormComponent form)
76: throws FormException;
77:
78: }
|