01: package org.gui4j.component;
02:
03: import java.awt.BorderLayout;
04: import java.awt.Component;
05:
06: import javax.swing.JPanel;
07:
08: import org.gui4j.Gui4jCallBase;
09: import org.gui4j.core.Gui4jComponentContainer;
10: import org.gui4j.core.Gui4jComponentInstance;
11: import org.gui4j.core.Gui4jQualifiedComponent;
12: import org.gui4j.core.Gui4jSwingContainer;
13:
14: public final class Gui4jExternalComponent extends
15: Gui4jAbstractPopupComponent {
16:
17: /**
18: * Constructor for Gui4jExternalComponent.
19: * @param gui4jComponentContainer
20: * @param componentClass
21: * @param id
22: */
23: public Gui4jExternalComponent(
24: Gui4jComponentContainer gui4jComponentContainer,
25: Class componentClass, String id) {
26: super (gui4jComponentContainer, componentClass, id);
27: }
28:
29: /* (non-Javadoc)
30: * @see org.gui4j.core.Gui4jAbstractComponent#createComponentInstance(org.gui4j.core.Gui4jSwingContainer, org.gui4j.Gui4jCallBase, org.gui4j.core.Gui4jQualifiedComponent)
31: */
32: protected Gui4jComponentInstance createComponentInstance(
33: Gui4jSwingContainer gui4jSwingContainer,
34: Gui4jCallBase gui4jCallBase,
35: Gui4jQualifiedComponent gui4jComponentInPath) {
36: /*
37: Component component =
38: (Component) mComponent.getValue(gui4jCallBase, null, null);
39: */
40: JPanel panel = new JPanel(new BorderLayout());
41: panel.setOpaque(false);
42: Gui4jComponentInstance gui4jComponentInstance = new Gui4jComponentInstance(
43: gui4jSwingContainer, panel, gui4jComponentInPath);
44: return gui4jComponentInstance;
45: }
46:
47: public void setComponent(
48: Gui4jComponentInstance gui4jComponentInstance,
49: Component component) {
50: JPanel panel = (JPanel) gui4jComponentInstance
51: .getSwingComponent();
52: // panel.removeAll();
53: panel.add(component, "Center");
54: }
55:
56: }
|