1 package net.matuschek.jobo; 2 3 import java.util.Vector ; 4 5 import javax.swing.BoxLayout ; 6 import javax.swing.JButton ; 7 import javax.swing.JPanel ; 8 import javax.swing.JScrollPane ; 9 import javax.swing.JTable ; 10 11 import net.matuschek.spider.RegExpURLCheck; 12 import net.matuschek.swing.JHideFrame; 13 import net.matuschek.swing.OptionPanel; 14 17 18 19 20 21 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 mainPanel = new JPanel (); 40 mainPanel.setLayout(new BoxLayout (mainPanel,BoxLayout.Y_AXIS)); 41 setContentPane(mainPanel); 42 43 OptionPanel dialogPanel = new OptionPanel(2); 44 45 JPanel buttonPanel = new JPanel (); 46 buttonPanel.setLayout(new BoxLayout (buttonPanel,BoxLayout.X_AXIS)); 47 48 mainPanel.add(dialogPanel); 49 mainPanel.add(buttonPanel); 50 51 54 55 Vector rules = check.getRules(); 57 RegExpRuleTableModel tableModel 58 = new RegExpRuleTableModel(check.getRules()); 59 JTable table = new JTable (tableModel); 60 JScrollPane scrollPane = new JScrollPane (table); 61 dialogPanel.add(scrollPane); 62 63 64 67 68 71 JButton okButton = new JButton (); 72 okButton.setText("OK"); 73 okButton.addActionListener(new java.awt.event.ActionListener () { 74 public void actionPerformed(java.awt.event.ActionEvent evt) { 75 updateAndHide(); 76 } 77 }); 78 buttonPanel.add(okButton); 79 80 JButton closeButton = new JButton (); 81 closeButton.setText("Cancel"); 82 closeButton.addActionListener(new java.awt.event.ActionListener () { 83 public void actionPerformed(java.awt.event.ActionEvent evt) { 84 exitForm(); 85 } 86 }); 87 buttonPanel.add(closeButton); 88 89 92 93 pack (); 94 updateFormFromURLCheck(); 95 } 96 97 98 101 protected void updateAndHide() { 102 this.setVisible(false); 103 } 104 105 106 110 protected void updateFormFromURLCheck() { 111 } 112 113 114 118 protected boolean updateURLCheckFromForm() { 119 return true; 120 } 121 122 123 124 125 126 127 RegExpURLCheck check = null; 128 129 130 133 134 } | Popular Tags |