001: /*
002: * Created on Sep 18, 2004
003: *
004: */
005: package com.pk.preferences;
006:
007: import java.awt.GridBagConstraints;
008: import java.awt.GridBagLayout;
009: import java.awt.Insets;
010: import java.awt.event.ActionListener;
011:
012: import javax.swing.BorderFactory;
013: import javax.swing.BoxLayout;
014: import javax.swing.JCheckBox;
015: import javax.swing.JLabel;
016: import javax.swing.JPanel;
017: import javax.swing.JTextField;
018:
019: import com.pk.Preferences;
020:
021: /**
022: * @author Chris Taylor
023: *
024: */
025: public class ExportPanel extends JPanel {
026: /**
027: *
028: */
029: private static final long serialVersionUID = -4466210421863384525L;
030:
031: private JTextField txtExportDelimiter = null;
032: private JTextField txtEncloseBy = null;
033: private JCheckBox useCdata = null;
034: private JTextField txtHeaderColor = null;
035: private JTextField txtBorderColor = null;
036: private JTextField txtAltRowColor = null;
037:
038: public ExportPanel(ActionListener argActionListener) {
039: JPanel delimPanel = new JPanel();
040: JPanel xmlPanel = new JPanel();
041: JPanel htmlPanel = new JPanel();
042:
043: this .setLayout(new BoxLayout(this , BoxLayout.Y_AXIS));
044: this .setSize(Preferences.HEIGHT, Preferences.WIDTH);
045:
046: JLabel label = new JLabel();
047: delimPanel.setLayout(new GridBagLayout());
048: GridBagConstraints gbc = new GridBagConstraints();
049: gbc.anchor = GridBagConstraints.WEST;
050: gbc.insets = new Insets(6, 15, 6, 15);
051:
052: gbc.gridx = 0;
053: gbc.gridy = 0;
054: label = new JLabel("Export Delimiter:", JLabel.LEFT);
055: delimPanel.add(label, gbc);
056:
057: gbc.gridy++;
058: label = new JLabel("Enclose By:", JLabel.LEFT);
059: delimPanel.add(label, gbc);
060: gbc.gridx = 1;
061: gbc.gridy = 0;
062:
063: txtExportDelimiter = new JTextField(5);
064: delimPanel.add(txtExportDelimiter, gbc);
065:
066: gbc.gridy++;
067: txtEncloseBy = new JTextField(5);
068: delimPanel.add(txtEncloseBy, gbc);
069: delimPanel.setBorder(BorderFactory
070: .createTitledBorder("Delimited File"));
071:
072: useCdata = new JCheckBox("Use CData");
073: xmlPanel.add(useCdata);
074: xmlPanel
075: .setBorder(BorderFactory.createTitledBorder("XML File"));
076:
077: htmlPanel.setLayout(new GridBagLayout());
078: gbc.gridx = 0;
079: gbc.gridy = 0;
080: label = new JLabel("Header Color:", JLabel.LEFT);
081: htmlPanel.add(label, gbc);
082:
083: gbc.gridy++;
084: label = new JLabel("Border Color:", JLabel.LEFT);
085: htmlPanel.add(label, gbc);
086:
087: gbc.gridy++;
088: label = new JLabel("Alt Row Color:", JLabel.LEFT);
089: htmlPanel.add(label, gbc);
090:
091: gbc.gridx = 1;
092: gbc.gridy = 0;
093:
094: txtHeaderColor = new JTextField(7);
095: htmlPanel.add(txtHeaderColor, gbc);
096:
097: gbc.gridy++;
098: txtBorderColor = new JTextField(7);
099: htmlPanel.add(txtBorderColor, gbc);
100:
101: gbc.gridy++;
102: txtAltRowColor = new JTextField(7);
103: htmlPanel.add(txtAltRowColor, gbc);
104:
105: htmlPanel.setBorder(BorderFactory
106: .createTitledBorder("HTML File"));
107:
108: this .add(delimPanel);
109: this .add(xmlPanel);
110: this .add(htmlPanel);
111: }
112:
113: /**
114: * @return Returns the txtEncloseBy.
115: */
116: public JTextField getTxtEncloseBy() {
117: return txtEncloseBy;
118: }
119:
120: /**
121: * @return Returns the txtExportDelimiter.
122: */
123: public JTextField getTxtExportDelimiter() {
124: return txtExportDelimiter;
125: }
126:
127: /**
128: * @return Returns the userCdata.
129: */
130: public JCheckBox getUseCdata() {
131: return useCdata;
132: }
133:
134: /**
135: * @return Returns the altRowColor.
136: */
137: public JTextField getAltRowColor() {
138: return txtAltRowColor;
139: }
140:
141: /**
142: * @return Returns the borderColor.
143: */
144: public JTextField getBorderColor() {
145: return txtBorderColor;
146: }
147:
148: /**
149: * @return Returns the headerColor.
150: */
151: public JTextField getHeaderColor() {
152: return txtHeaderColor;
153: }
154: }
|