KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > matuschek > jobo > URLCheckConfigFrame


1 package net.matuschek.jobo;
2
3 import java.util.Vector JavaDoc;
4
5 import javax.swing.BoxLayout JavaDoc;
6 import javax.swing.JButton JavaDoc;
7 import javax.swing.JPanel JavaDoc;
8 import javax.swing.JScrollPane JavaDoc;
9 import javax.swing.JTable JavaDoc;
10
11 import net.matuschek.spider.RegExpURLCheck;
12 import net.matuschek.swing.JHideFrame;
13 import net.matuschek.swing.OptionPanel;
14 /*********************************************
15     Copyright (c) 2001 by Daniel Matuschek
16 *********************************************/

17
18
19
20
21 /**
22  * Swing Configuration frame for the RegExpURLCheck rules
23  *
24  * @author Daniel Matuschek
25  * @version $Id $
26  */

27 public class URLCheckConfigFrame extends JHideFrame {
28
29     private static final long serialVersionUID = 7588707167267231914L;
30
31 public URLCheckConfigFrame(RegExpURLCheck check) {
32     super("URLCheck configuration");
33     this.check = check;
34     initComponents();
35   }
36
37
38   protected void initComponents() {
39     JPanel JavaDoc mainPanel = new JPanel JavaDoc();
40     mainPanel.setLayout(new BoxLayout JavaDoc(mainPanel,BoxLayout.Y_AXIS));
41     setContentPane(mainPanel);
42
43     OptionPanel dialogPanel = new OptionPanel(2);
44
45     JPanel JavaDoc buttonPanel = new JPanel JavaDoc();
46     buttonPanel.setLayout(new BoxLayout JavaDoc(buttonPanel,BoxLayout.X_AXIS));
47
48     mainPanel.add(dialogPanel);
49     mainPanel.add(buttonPanel);
50
51     /**
52        Input fields
53      **/

54
55     // table
56
Vector JavaDoc rules = check.getRules();
57     RegExpRuleTableModel tableModel
58       = new RegExpRuleTableModel(check.getRules());
59     JTable JavaDoc table = new JTable JavaDoc(tableModel);
60     JScrollPane JavaDoc scrollPane = new JScrollPane JavaDoc(table);
61     dialogPanel.add(scrollPane);
62
63
64     /**
65        End of input fields
66      **/

67
68     /**
69        Button panel
70      **/

71     JButton JavaDoc okButton = new JButton JavaDoc();
72     okButton.setText("OK");
73     okButton.addActionListener(new java.awt.event.ActionListener JavaDoc() {
74     public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
75       updateAndHide();
76     }
77       });
78     buttonPanel.add(okButton);
79
80     JButton JavaDoc closeButton = new JButton JavaDoc();
81     closeButton.setText("Cancel");
82     closeButton.addActionListener(new java.awt.event.ActionListener JavaDoc() {
83     public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
84       exitForm();
85     }
86       });
87     buttonPanel.add(closeButton);
88
89     /**
90        End of button panel
91     **/

92
93     pack ();
94     updateFormFromURLCheck();
95   }
96
97
98   /**
99      update the RegExpURLCheck form dialog
100   **/

101   protected void updateAndHide() {
102     this.setVisible(false);
103   }
104
105
106   /**
107       update the content of the form field from the current robot
108       settings
109   **/

110   protected void updateFormFromURLCheck() {
111   }
112
113
114   /**
115      update the URLCheck settings from the current fields
116      @return true if everything is okay, false otherwise
117   **/

118   protected boolean updateURLCheckFromForm() {
119     return true;
120   }
121
122   /**********************************************************************/
123   /**********************************************************************/
124   /**********************************************************************/
125
126   /** the RegExpURLCheck to configure **/
127   RegExpURLCheck check = null;
128
129
130   // input fields
131
//
132

133   
134 } // URLCheckConfigFrame
135
Popular Tags