KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > kelp > ant > deployer > AntDeployInputPanel


1 package org.enhydra.kelp.ant.deployer;
2
3 import java.awt.*;
4 import org.enhydra.tool.swing.layout.*;
5 import javax.swing.*;
6 import org.enhydra.kelp.ant.node.AntProject;
7 import org.enhydra.kelp.common.node.OtterProject;
8 import java.util.ResourceBundle JavaDoc;
9 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 JavaDoc res = ResourceBundle.getBundle(
22                             "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 =
32             new AntDeployInputTemplatesPanel();
33     AntDeployInputReplacementsPanel replacementsPanel =
34             new AntDeployInputReplacementsPanel();
35
36     public AntDeployInputPanel() {
37         try {
38             jbInit();
39             pmInit();
40         }
41         catch(Exception JavaDoc ex) {
42             ex.printStackTrace();
43         }
44     }
45
46     private void pmInit() {
47         tab.add(res.getString("Documents"), documentsPanel);
48         tab.add(res.getString("Replacements"), replacementsPanel);
49     }
50
51     void jbInit() throws Exception JavaDoc {
52         jLabelHeading.setFont(new java.awt.Font JavaDoc("Dialog", 1, 12));
53         jLabelHeading.setText(res.getString("Input_templates"));
54         this.setLayout(xYLayout1);
55         jTextDescr.setBackground(SystemColor.control);
56         jTextDescr.setEnabled(false);
57         jTextDescr.setFont(new java.awt.Font JavaDoc("SansSerif", 0, 12));
58         jTextDescr.setDisabledTextColor(SystemColor.controlText);
59         jTextDescr.setEditable(false);
60         jTextDescr.setText(res.getString("Input_description"));
61         jTextDescr.setLineWrap(true);
62         jTextDescr.setWrapStyleWord(true);
63         xYLayout1.setWidth(540);
64         xYLayout1.setHeight(404);
65         jCheckEnable.setText(res.getString("Enable_input_deployment"));
66         this.add(jLabelHeading, new XYConstraints(13, 1, 96, 25));
67         this.add(jTextDescr, new XYConstraints(13, 26, 519, 50));
68         this.add(jCheckEnable, new XYConstraints(13, 75, 180, 19));
69         this.add(tab, new XYConstraints(7, 99, 525, 272));
70     }
71
72     public void setProject(OtterProject otterProject){
73         replacementsPanel.setProject(otterProject);
74         documentsPanel.setProject(otterProject);
75         if(otterProject instanceof AntProject) {
76             project = (AntProject) otterProject;
77             initOptions();
78         }
79         else
80             System.err.println("DEBUG project must be AntProject");//FIXME throw Exception
81
}
82
83     private void initOptions(){
84         if(project.getProperty(AntProject.DEPLOY_INPUT_ENABLED).equalsIgnoreCase("true"))
85             jCheckEnable.setSelected(true);
86         else
87             jCheckEnable.setSelected(false);
88         //read all input files and fill documents panel
89
}
90
91     protected void setNodes(OtterFileNode[] n) {
92         //documentsPanel.setNodes(n);
93
}
94
95 }
Popular Tags