01: package org.enhydra.kelp.ant.deployer;
02:
03: import java.awt.*;
04: import org.enhydra.tool.swing.layout.*;
05: import javax.swing.*;
06: import org.enhydra.kelp.ant.node.AntProject;
07: import org.enhydra.kelp.common.node.OtterProject;
08: import java.util.ResourceBundle;
09: import org.enhydra.kelp.common.node.OtterFileNode;
10:
11: /**
12: * <p>Title: </p>
13: * <p>Description: </p>
14: * <p>Copyright: Copyright (c) 2003</p>
15: * <p>Company: </p>
16: * @author unascribed
17: * @version 1.0
18: */
19:
20: public class AntDeployInputPanel extends JPanel {
21: static ResourceBundle res = ResourceBundle
22: .getBundle("org.enhydra.kelp.common.Res");
23:
24: XYLayout xYLayout1 = new XYLayout();
25: JLabel jLabelHeading = new JLabel();
26: JTextArea jTextDescr = new JTextArea();
27:
28: private AntProject project = null;
29: JCheckBox jCheckEnable = new JCheckBox();
30: JTabbedPane tab = new JTabbedPane();
31: AntDeployInputTemplatesPanel documentsPanel = new AntDeployInputTemplatesPanel();
32: AntDeployInputReplacementsPanel replacementsPanel = new AntDeployInputReplacementsPanel();
33:
34: public AntDeployInputPanel() {
35: try {
36: jbInit();
37: pmInit();
38: } catch (Exception ex) {
39: ex.printStackTrace();
40: }
41: }
42:
43: private void pmInit() {
44: tab.add(res.getString("Documents"), documentsPanel);
45: tab.add(res.getString("Replacements"), replacementsPanel);
46: }
47:
48: void jbInit() throws Exception {
49: jLabelHeading.setFont(new java.awt.Font("Dialog", 1, 12));
50: jLabelHeading.setText(res.getString("Input_templates"));
51: this .setLayout(xYLayout1);
52: jTextDescr.setBackground(SystemColor.control);
53: jTextDescr.setEnabled(false);
54: jTextDescr.setFont(new java.awt.Font("SansSerif", 0, 12));
55: jTextDescr.setDisabledTextColor(SystemColor.controlText);
56: jTextDescr.setEditable(false);
57: jTextDescr.setText(res.getString("Input_description"));
58: jTextDescr.setLineWrap(true);
59: jTextDescr.setWrapStyleWord(true);
60: xYLayout1.setWidth(540);
61: xYLayout1.setHeight(404);
62: jCheckEnable.setText(res.getString("Enable_input_deployment"));
63: this .add(jLabelHeading, new XYConstraints(13, 1, 96, 25));
64: this .add(jTextDescr, new XYConstraints(13, 26, 519, 50));
65: this .add(jCheckEnable, new XYConstraints(13, 75, 180, 19));
66: this .add(tab, new XYConstraints(7, 99, 525, 272));
67: }
68:
69: public void setProject(OtterProject otterProject) {
70: replacementsPanel.setProject(otterProject);
71: documentsPanel.setProject(otterProject);
72: if (otterProject instanceof AntProject) {
73: project = (AntProject) otterProject;
74: initOptions();
75: } else
76: System.err.println("DEBUG project must be AntProject");//FIXME throw Exception
77: }
78:
79: private void initOptions() {
80: if (project.getProperty(AntProject.DEPLOY_INPUT_ENABLED)
81: .equalsIgnoreCase("true"))
82: jCheckEnable.setSelected(true);
83: else
84: jCheckEnable.setSelected(false);
85: //read all input files and fill documents panel
86: }
87:
88: protected void setNodes(OtterFileNode[] n) {
89: //documentsPanel.setNodes(n);
90: }
91:
92: }
|