r12967 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12966‎ | r12967 | r12968 >
Date:02:45, 7 February 2006
Author:vibber
Status:old
Tags:
Comment:
Work in progress:
* Can actually send stuff to the database now, but some odd behavior/breakage
* Checks for presence of database and tables
* Various UI suckage
Modified paths:
  • /trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperGui.java (modified) (history)
  • /trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperWindow.java (modified) (history)
  • /trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperWindowForm.form (modified) (history)
  • /trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperWindowForm.java (modified) (history)

Diff [purge]

Index: trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperGui.java
@@ -6,6 +6,7 @@
77 import java.io.InputStream;
88 import java.sql.Connection;
99 import java.sql.DriverManager;
 10+import java.sql.Statement;
1011
1112 import org.mediawiki.dumper.Tools;
1213 import org.mediawiki.importer.DumpWriter;
@@ -15,15 +16,31 @@
1617
1718 public class DumperGui {
1819 private DumperWindow gui;
19 - private boolean running = false;
 20+
 21+ // status
 22+ public boolean running = false;
 23+ public boolean connected = false;
 24+ public boolean schemaReady = false;
 25+
 26+ // other goodies
 27+ String host = "localhost";
 28+ String port = "3306";
 29+ String username = "root";
 30+ String password = "";
 31+
 32+ String schema = "1.5";
 33+ String dbname = "wikidb";
 34+ String prefix = "";
 35+
2036 XmlDumpReader reader;
2137 Connection conn;
2238
23 - public boolean isConnected() {
24 - return (conn != null);
25 - }
26 -
2739 void connect(String host, String port, String username, String password) {
 40+ assert !connected;
 41+ assert conn == null;
 42+ assert !running;
 43+ assert !schemaReady;
 44+
2845 try {
2946 Class.forName("com.mysql.jdbc.Driver").newInstance();
3047 } catch (ClassNotFoundException ex) {
@@ -33,6 +50,7 @@
3451 } catch (IllegalAccessException ex) {
3552 ex.printStackTrace();
3653 }
 54+ gui.setDatabaseStatus("Connecting...");
3755 try {
3856 // fixme is there escaping? is this a url? fucking java bullshit
3957 String url =
@@ -43,28 +61,86 @@
4462 "&password=" + password;
4563 System.err.println("Connecting to " + url);
4664 conn = DriverManager.getConnection(url);
47 - gui.connectionSucceeded();
 65+ connected = true;
 66+ gui.setDatabaseStatus("Connected.");
 67+ gui.showFields();
 68+ checkSchema();
4869 } catch (SQLException ex) {
49 - conn = null;
 70+ gui.setDatabaseStatus("Failed to connect.");
5071 ex.printStackTrace();
51 - gui.connectionFailed();
5272 }
 73+
 74+ assert (connected == (conn != null));
5375 }
5476
5577 void disconnect() {
 78+ assert connected;
 79+ assert conn != null;
 80+ assert !running;
5681 try {
5782 conn.close();
5883 conn = null;
59 - gui.connectionClosed();
 84+ connected = false;
 85+ gui.setDatabaseStatus("Disconnected.");
 86+ gui.showFields();
 87+ checkSchema();
6088 } catch (SQLException ex) {
6189 ex.printStackTrace();
6290 }
 91+ assert !connected;
 92+ assert conn == null;
6393 }
 94+
 95+ void setDbname(String dbname) {
 96+ this.dbname = dbname;
 97+ checkSchema();
 98+ }
 99+
 100+ void checkSchema() {
 101+ schemaReady = false;
 102+ if (connected) {
 103+ gui.setSchemaStatus("Checking...");
 104+ try {
 105+ conn.setCatalog(dbname);
 106+ String[] tables = testTables();
 107+ for (int i = 0; i < tables.length; i++) {
 108+ Statement sql = conn.createStatement();
 109+ sql.execute("SELECT 1 FROM " + tables[i] + " LIMIT 0");
 110+ }
 111+ schemaReady = true;
 112+ gui.setSchemaStatus("Ready");
 113+ } catch (SQLException e) {
 114+ gui.setSchemaStatus("Error: " + e.getMessage());
 115+ }
 116+ } else {
 117+ gui.setSchemaStatus("Not connected.");
 118+ }
 119+ gui.showFields();
 120+ assert !(schemaReady && !connected) : "Schema can't be ready if disconnected.";
 121+ }
 122+
 123+ String[] testTables() {
 124+ if (schema.equals("1.4"))
 125+ return new String[] {
 126+ prefix + "cur",
 127+ prefix + "old"};
 128+ else
 129+ return new String[] {
 130+ prefix + "page",
 131+ prefix + "revision",
 132+ prefix + "text"};
 133+ }
64134
65 - void startImport(String inputFile) throws IOException {
 135+ void startImport(String inputFile) throws IOException, SQLException {
 136+ assert connected;
 137+ assert conn != null;
 138+ assert schemaReady;
 139+ assert !running;
 140+
66141 // TODO work right ;)
67142 final InputStream stream = Tools.openInputFile(inputFile);
68143 //DumpWriter writer = new MultiWriter();
 144+ conn.setCatalog(dbname);
69145 SqlServerStream sqlStream = new SqlServerStream(conn);
70146 DumpWriter writer = new SqlWriter15(sqlStream);
71147 DumpWriter progress = gui.getProgressWriter(writer, 1000);
@@ -72,7 +148,7 @@
73149 new Thread() {
74150 public void run() {
75151 running = true;
76 - gui.start();
 152+ gui.showFields();
77153 gui.setProgress("Starting import...");
78154 try {
79155 reader.readDump();
@@ -82,7 +158,7 @@
83159 }
84160 running = false;
85161 reader = null;
86 - gui.stop();
 162+ gui.showFields();
87163 }
88164 }.start();
89165 }
Index: trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperWindow.java
@@ -13,8 +13,11 @@
1414 import java.awt.FileDialog;
1515 import java.io.File;
1616 import java.io.IOException;
 17+import java.sql.SQLException;
1718 import javax.swing.JFileChooser;
1819 import javax.swing.SwingUtilities;
 20+import javax.swing.event.DocumentEvent;
 21+import javax.swing.event.DocumentListener;
1922 import org.mediawiki.importer.DumpWriter;
2023
2124 /**
@@ -24,91 +27,79 @@
2528 public class DumperWindow extends DumperWindowForm {
2629 protected DumperGui backend;
2730
28 - private static final int STOPPED = 0;
29 - private static final int RUNNING = 1;
30 - private int mode = STOPPED;
31 -
3231 /** Creates a new instance of DumperWindow */
33 - public DumperWindow(DumperGui backend) {
34 - this.backend = backend;
 32+ public DumperWindow(DumperGui aBackend) {
 33+ super();
 34+ backend = aBackend;
 35+ dbnameText.getDocument().addDocumentListener(new DocumentListener() {
 36+ public void changedUpdate(DocumentEvent e) {
 37+ backend.setDbname(dbnameText.getText());
 38+ }
 39+ public void insertUpdate(DocumentEvent e) {
 40+ backend.setDbname(dbnameText.getText());
 41+ }
 42+ public void removeUpdate(DocumentEvent e) {
 43+ backend.setDbname(dbnameText.getText());
 44+ }
 45+ });
3546 }
3647
3748 public DumpWriter getProgressWriter(DumpWriter sink, int interval) {
3849 return new GraphicalProgressFilter(sink, interval, progressLabel);
3950 }
4051
41 - public void start() {
42 - // disable the other fields...
43 - setFieldsEnabled(false);
44 - startButton.setText("Cancel");
45 - mode = RUNNING;
 52+ /**
 53+ * Update all the fields' enabled flags and button names.
 54+ */
 55+ public void showFields() {
 56+ showBrowseFields();
 57+ showDatabaseFields();
 58+ showSchemaFields();
 59+ showImportFields();
4660 }
4761
48 - public void stop() {
49 - startButton.setText("Start import");
50 - setFieldsEnabled(true);
51 - mode = STOPPED;
 62+ void showBrowseFields() {
 63+ enableFields(new Component[] { fileText, browseButton },
 64+ !backend.running);
5265 }
5366
54 - void setFieldsEnabled(boolean val) {
55 - final boolean _val = val;
56 - SwingUtilities.invokeLater(new Runnable() {
57 - public void run() {
58 - Component[] widgets = new Component[] {
59 - fileText,
60 - browseButton,
61 -
62 - serverText,
63 - portText,
64 - userText,
65 - passwordText,
66 - connectButton,
67 -
68 - schema14Radio,
69 - schema15Radio,
70 - prefixText };
71 - for (int i = 0; i < widgets.length; i++) {
72 - widgets[i].setEnabled(_val);
73 - }
74 - }
75 - });
 67+ void showDatabaseFields() {
 68+ enableFields(new Component[] {
 69+ serverLabel,
 70+ serverText,
 71+ portLabel,
 72+ portText,
 73+ userLabel,
 74+ userText,
 75+ passwordLabel,
 76+ passwordText},
 77+ !backend.running && !backend.connected);
 78+ connectButton.setEnabled(!backend.running);
 79+ connectButton.setText(backend.connected ? "Disconnect" : "Connect");
7680 }
7781
78 - void setDatabaseFieldsEnabled(boolean val) {
79 - final boolean _val = val;
80 - SwingUtilities.invokeLater(new Runnable() {
81 - public void run() {
82 - Component[] widgets = new Component[] {
83 - serverText,
84 - portText,
85 - userText,
86 - passwordText};
87 - for (int i = 0; i < widgets.length; i++) {
88 - widgets[i].setEnabled(_val);
89 - }
90 - startButton.setEnabled(!_val);
91 - }
92 - });
 82+ void showSchemaFields() {
 83+ enableFields(new Component[] {
 84+ schema14Radio,
 85+ schema15Radio,
 86+ prefixLabel,
 87+ prefixText,
 88+ dbnameLabel,
 89+ dbnameText},
 90+ !backend.running && backend.connected);
9391 }
9492
95 - void connectionSucceeded() {
96 - setProgress("Connected to server!");
97 - setDatabaseFieldsEnabled(false);
98 - connectButton.setText("Disconnect");
 93+ void showImportFields() {
 94+ startButton.setEnabled(backend.connected && backend.schemaReady);
 95+ startButton.setText(backend.running ? "Cancel" : "Start import");
9996 }
10097
101 - void connectionFailed() {
102 - setProgress("Connection failed. :(");
103 - setDatabaseFieldsEnabled(true);
104 - connectButton.setText("Connect");
 98+ void enableFields(Component[] widgets, boolean val) {
 99+ for (int i = 0; i < widgets.length; i++) {
 100+ widgets[i].setEnabled(val);
 101+ }
105102 }
106103
107 - void connectionClosed() {
108 - setProgress("Connection closed.");
109 - setDatabaseFieldsEnabled(true);
110 - connectButton.setText("Connect");
111 - }
112 -
113104 /**
114105 * Set the progress bar text asynchronously, eg from a background thread
115106 */
@@ -121,6 +112,14 @@
122113 });
123114 }
124115
 116+ public void setDatabaseStatus(String text) {
 117+ dbStatusLabel.setText(text);
 118+ }
 119+
 120+ public void setSchemaStatus(String text) {
 121+ schemaStatusLabel.setText(text);
 122+ }
 123+
125124 /* -- event handlers -- */
126125
127126 protected void onBrowseButtonActionPerformed(java.awt.event.ActionEvent evt) {
@@ -134,7 +133,42 @@
135134 }
136135 }
137136 }
 137+ protected void onConnectButtonActionPerformed(java.awt.event.ActionEvent evt) {
 138+ if (backend.connected)
 139+ backend.disconnect();
 140+ else
 141+ backend.connect(serverText.getText(),
 142+ portText.getText(),
 143+ userText.getText(),
 144+ passwordText.getText());
 145+ }
138146
 147+ protected void onStartButtonActionPerformed(java.awt.event.ActionEvent evt) {
 148+ if (backend.running) {
 149+ backend.abort();
 150+ } else {
 151+ try {
 152+ backend.startImport(fileText.getText());
 153+ } catch (IOException e1) {
 154+ // TODO Auto-generated catch block
 155+ e1.printStackTrace();
 156+ } catch (SQLException e1) {
 157+ // TODO Auto-generated catch block
 158+ e1.printStackTrace();
 159+ }
 160+ }
 161+ }
 162+
 163+ protected void onQuitItemActionPerformed(java.awt.event.ActionEvent evt) {
 164+ System.exit(0);
 165+ }
 166+
 167+ protected void onDbnameTextActionPerformed(java.awt.event.ActionEvent evt) {
 168+ backend.setDbname(dbnameText.getText());
 169+ }
 170+
 171+ /* ---- more random crap ---- */
 172+
139173 File chooseFile(String message) {
140174 String os = System.getProperty("os.name");
141175 boolean swingSucks = (os.equals("Mac OS X") || os.startsWith("Win"));
@@ -172,31 +206,4 @@
173207 return chooser.getSelectedFile();
174208 }
175209
176 - protected void onConnectButtonActionPerformed(java.awt.event.ActionEvent evt) {
177 - if (backend.isConnected())
178 - backend.disconnect();
179 - else
180 - backend.connect(serverText.getText(),
181 - portText.getText(),
182 - userText.getText(),
183 - passwordText.getText());
184 - }
185 -
186 - protected void onStartButtonActionPerformed(java.awt.event.ActionEvent evt) {
187 - if (mode == RUNNING) {
188 - backend.abort();
189 - } else {
190 - try {
191 - backend.startImport(fileText.getText());
192 - } catch (IOException e1) {
193 - // TODO Auto-generated catch block
194 - e1.printStackTrace();
195 - }
196 - }
197 - }
198 -
199 - protected void onQuitItemActionPerformed(java.awt.event.ActionEvent evt) {
200 - System.exit(0);
201 - }
202 -
203210 }
Index: trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperWindowForm.java
@@ -38,12 +38,16 @@
3939 passwordLabel = new javax.swing.JLabel();
4040 passwordText = new javax.swing.JPasswordField();
4141 connectButton = new javax.swing.JButton();
 42+ dbStatusLabel = new javax.swing.JLabel();
4243 schemaPanel = new javax.swing.JPanel();
4344 schemaLabel = new javax.swing.JLabel();
4445 schema14Radio = new javax.swing.JRadioButton();
4546 schema15Radio = new javax.swing.JRadioButton();
4647 prefixLabel = new javax.swing.JLabel();
4748 prefixText = new javax.swing.JTextField();
 49+ dbnameLabel = new javax.swing.JLabel();
 50+ dbnameText = new javax.swing.JTextField();
 51+ schemaStatusLabel = new javax.swing.JLabel();
4852 progressPanel = new javax.swing.JPanel();
4953 progressLabel = new javax.swing.JLabel();
5054 startButton = new javax.swing.JButton();
@@ -67,7 +71,7 @@
6872 filePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
6973 .add(filePanelLayout.createSequentialGroup()
7074 .addContainerGap()
71 - .add(fileText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 402, Short.MAX_VALUE)
 75+ .add(fileText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 439, Short.MAX_VALUE)
7276 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
7377 .add(browseButton)
7478 .addContainerGap())
@@ -104,6 +108,8 @@
105109 }
106110 });
107111
 112+ dbStatusLabel.setText("Not connected.");
 113+
108114 org.jdesktop.layout.GroupLayout databasePanelLayout = new org.jdesktop.layout.GroupLayout(databasePanel);
109115 databasePanel.setLayout(databasePanelLayout);
110116 databasePanelLayout.setHorizontalGroup(
@@ -111,18 +117,21 @@
112118 .add(databasePanelLayout.createSequentialGroup()
113119 .addContainerGap()
114120 .add(databasePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
115 - .add(serverLabel)
116 - .add(portLabel)
117 - .add(passwordLabel)
118 - .add(userLabel))
119 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
120 - .add(databasePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
121 - .add(passwordText)
122 - .add(userText)
123 - .add(portText)
124 - .add(org.jdesktop.layout.GroupLayout.TRAILING, serverText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
125 - .add(connectButton))
126 - .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 121+ .add(dbStatusLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)
 122+ .add(databasePanelLayout.createSequentialGroup()
 123+ .add(databasePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 124+ .add(serverLabel)
 125+ .add(portLabel)
 126+ .add(passwordLabel)
 127+ .add(userLabel))
 128+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 129+ .add(databasePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
 130+ .add(passwordText)
 131+ .add(userText)
 132+ .add(portText)
 133+ .add(org.jdesktop.layout.GroupLayout.TRAILING, serverText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
 134+ .add(connectButton))))
 135+ .addContainerGap())
127136 );
128137 databasePanelLayout.setVerticalGroup(
129138 databasePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
@@ -145,16 +154,20 @@
146155 .add(passwordText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
147156 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
148157 .add(connectButton)
149 - .addContainerGap(53, Short.MAX_VALUE))
 158+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 17, Short.MAX_VALUE)
 159+ .add(dbStatusLabel)
 160+ .addContainerGap())
150161 );
151162
152163 schemaPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("MediaWiki schema"));
153164 schemaLabel.setText("Table layout for version");
154165
 166+ schemaRadios.add(schema14Radio);
155167 schema14Radio.setText("1.4 (cur, old)");
156168 schema14Radio.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
157169 schema14Radio.setMargin(new java.awt.Insets(0, 0, 0, 0));
158170
 171+ schemaRadios.add(schema15Radio);
159172 schema15Radio.setSelected(true);
160173 schema15Radio.setText("1.5 (page, revision, text)");
161174 schema15Radio.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
@@ -162,6 +175,17 @@
163176
164177 prefixLabel.setText("Table prefix");
165178
 179+ dbnameLabel.setText("Database");
 180+
 181+ dbnameText.setText("wikidb");
 182+ dbnameText.addActionListener(new java.awt.event.ActionListener() {
 183+ public void actionPerformed(java.awt.event.ActionEvent evt) {
 184+ dbnameTextActionPerformed(evt);
 185+ }
 186+ });
 187+
 188+ schemaStatusLabel.setText("Not connected.");
 189+
166190 org.jdesktop.layout.GroupLayout schemaPanelLayout = new org.jdesktop.layout.GroupLayout(schemaPanel);
167191 schemaPanel.setLayout(schemaPanelLayout);
168192 schemaPanelLayout.setHorizontalGroup(
@@ -170,19 +194,26 @@
171195 .addContainerGap()
172196 .add(schemaPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
173197 .add(schemaPanelLayout.createSequentialGroup()
174 - .add(prefixLabel)
175 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
176 - .add(prefixText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)
177 - .addContainerGap(54, Short.MAX_VALUE))
 198+ .add(schemaStatusLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 260, Short.MAX_VALUE)
 199+ .addContainerGap())
178200 .add(schemaPanelLayout.createSequentialGroup()
179201 .add(schema15Radio)
180 - .addContainerGap(54, Short.MAX_VALUE))
 202+ .addContainerGap(105, Short.MAX_VALUE))
181203 .add(schemaPanelLayout.createSequentialGroup()
182204 .add(schema14Radio)
183 - .addContainerGap(127, Short.MAX_VALUE))
 205+ .addContainerGap(178, Short.MAX_VALUE))
184206 .add(schemaPanelLayout.createSequentialGroup()
185207 .add(schemaLabel)
186 - .addContainerGap(80, Short.MAX_VALUE))))
 208+ .addContainerGap(131, Short.MAX_VALUE))
 209+ .add(schemaPanelLayout.createSequentialGroup()
 210+ .add(schemaPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 211+ .add(prefixLabel)
 212+ .add(dbnameLabel))
 213+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 214+ .add(schemaPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 215+ .add(dbnameText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)
 216+ .add(prefixText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE))
 217+ .add(105, 105, 105))))
187218 );
188219 schemaPanelLayout.setVerticalGroup(
189220 schemaPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
@@ -197,13 +228,18 @@
198229 .add(schemaPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
199230 .add(prefixLabel)
200231 .add(prefixText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
201 - .addContainerGap(93, Short.MAX_VALUE))
 232+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 233+ .add(schemaPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 234+ .add(dbnameLabel)
 235+ .add(dbnameText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 236+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 27, Short.MAX_VALUE)
 237+ .add(schemaStatusLabel)
 238+ .addContainerGap())
202239 );
203240
204241 progressLabel.setText("Select a file...");
205242
206243 startButton.setText("Start import");
207 - startButton.setEnabled(false);
208244 startButton.addActionListener(new java.awt.event.ActionListener() {
209245 public void actionPerformed(java.awt.event.ActionEvent evt) {
210246 startButtonActionPerformed(evt);
@@ -217,7 +253,7 @@
218254 .add(progressPanelLayout.createSequentialGroup()
219255 .addContainerGap()
220256 .add(progressLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 383, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
221 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 257+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 46, Short.MAX_VALUE)
222258 .add(startButton)
223259 .addContainerGap())
224260 );
@@ -256,7 +292,7 @@
257293 .add(org.jdesktop.layout.GroupLayout.LEADING, filePanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
258294 .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
259295 .add(databasePanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
260 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 14, Short.MAX_VALUE)
 296+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
261297 .add(schemaPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
262298 .addContainerGap())
263299 );
@@ -266,16 +302,20 @@
267303 .addContainerGap()
268304 .add(filePanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
269305 .add(22, 22, 22)
270 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
271 - .add(databasePanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
272 - .add(schemaPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
273 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 306+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
 307+ .add(schemaPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 308+ .add(databasePanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 309+ .add(6, 6, 6)
274310 .add(progressPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
275311 .addContainerGap())
276312 );
277313 pack();
278314 }// </editor-fold>//GEN-END:initComponents
279315
 316+ private void dbnameTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dbnameTextActionPerformed
 317+ onDbnameTextActionPerformed(evt); // i hate you, netbeans gui editor
 318+ }//GEN-LAST:event_dbnameTextActionPerformed
 319+
280320 private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed
281321 onBrowseButtonActionPerformed(evt); // i hate you, netbeans gui editor
282322 }//GEN-LAST:event_browseButtonActionPerformed
@@ -307,6 +347,9 @@
308348 protected javax.swing.JButton browseButton;
309349 protected javax.swing.JButton connectButton;
310350 protected javax.swing.JPanel databasePanel;
 351+ protected javax.swing.JLabel dbStatusLabel;
 352+ protected javax.swing.JLabel dbnameLabel;
 353+ protected javax.swing.JTextField dbnameText;
311354 protected javax.swing.JMenu fileMenu;
312355 protected javax.swing.JPanel filePanel;
313356 protected javax.swing.JTextField fileText;
@@ -325,6 +368,7 @@
326369 protected javax.swing.JLabel schemaLabel;
327370 protected javax.swing.JPanel schemaPanel;
328371 protected javax.swing.ButtonGroup schemaRadios;
 372+ protected javax.swing.JLabel schemaStatusLabel;
329373 protected javax.swing.JLabel serverLabel;
330374 protected javax.swing.JTextField serverText;
331375 protected javax.swing.JButton startButton;
@@ -347,5 +391,9 @@
348392 protected void onQuitItemActionPerformed(java.awt.event.ActionEvent evt) {
349393 // TODO add your handling code here:
350394 }
351 -
 395+
 396+ protected void onDbnameTextActionPerformed(java.awt.event.ActionEvent evt) {
 397+// TODO add your handling code here:
 398+ }
 399+
352400 }
Index: trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperWindowForm.form
@@ -48,7 +48,7 @@
4949 <Component id="filePanel" alignment="0" max="32767" attributes="0"/>
5050 <Group type="102" alignment="0" attributes="0">
5151 <Component id="databasePanel" min="-2" max="-2" attributes="0"/>
52 - <EmptySpace pref="14" max="32767" attributes="0"/>
 52+ <EmptySpace max="32767" attributes="0"/>
5353 <Component id="schemaPanel" min="-2" max="-2" attributes="0"/>
5454 </Group>
5555 </Group>
@@ -62,11 +62,11 @@
6363 <EmptySpace max="-2" attributes="0"/>
6464 <Component id="filePanel" min="-2" max="-2" attributes="0"/>
6565 <EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
66 - <Group type="103" groupAlignment="0" attributes="0">
67 - <Component id="databasePanel" min="-2" max="-2" attributes="1"/>
68 - <Component id="schemaPanel" min="-2" max="-2" attributes="1"/>
 66+ <Group type="103" groupAlignment="0" max="-2" attributes="0">
 67+ <Component id="schemaPanel" max="32767" attributes="1"/>
 68+ <Component id="databasePanel" alignment="0" max="32767" attributes="1"/>
6969 </Group>
70 - <EmptySpace max="-2" attributes="0"/>
 70+ <EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
7171 <Component id="progressPanel" max="32767" attributes="0"/>
7272 <EmptySpace max="-2" attributes="0"/>
7373 </Group>
@@ -81,7 +81,7 @@
8282 <Group type="103" groupAlignment="0" attributes="0">
8383 <Group type="102" alignment="0" attributes="0">
8484 <EmptySpace max="-2" attributes="0"/>
85 - <Component id="fileText" pref="402" max="32767" attributes="0"/>
 85+ <Component id="fileText" pref="439" max="32767" attributes="0"/>
8686 <EmptySpace max="-2" attributes="0"/>
8787 <Component id="browseButton" min="-2" max="-2" attributes="0"/>
8888 <EmptySpace max="-2" attributes="0"/>
@@ -132,20 +132,25 @@
133133 <Group type="102" alignment="0" attributes="0">
134134 <EmptySpace max="-2" attributes="0"/>
135135 <Group type="103" groupAlignment="0" attributes="0">
136 - <Component id="serverLabel" alignment="0" min="-2" max="-2" attributes="0"/>
137 - <Component id="portLabel" alignment="0" min="-2" max="-2" attributes="0"/>
138 - <Component id="passwordLabel" alignment="0" min="-2" max="-2" attributes="0"/>
139 - <Component id="userLabel" min="-2" max="-2" attributes="0"/>
 136+ <Component id="dbStatusLabel" alignment="0" pref="205" max="32767" attributes="0"/>
 137+ <Group type="102" alignment="0" attributes="0">
 138+ <Group type="103" groupAlignment="0" attributes="0">
 139+ <Component id="serverLabel" alignment="0" min="-2" max="-2" attributes="0"/>
 140+ <Component id="portLabel" alignment="0" min="-2" max="-2" attributes="0"/>
 141+ <Component id="passwordLabel" alignment="0" min="-2" max="-2" attributes="0"/>
 142+ <Component id="userLabel" min="-2" max="-2" attributes="0"/>
 143+ </Group>
 144+ <EmptySpace max="-2" attributes="0"/>
 145+ <Group type="103" groupAlignment="0" max="-2" attributes="0">
 146+ <Component id="passwordText" max="32767" attributes="1"/>
 147+ <Component id="userText" max="32767" attributes="1"/>
 148+ <Component id="portText" max="32767" attributes="1"/>
 149+ <Component id="serverText" alignment="1" pref="136" max="32767" attributes="1"/>
 150+ <Component id="connectButton" alignment="0" min="-2" max="-2" attributes="0"/>
 151+ </Group>
 152+ </Group>
140153 </Group>
141154 <EmptySpace max="-2" attributes="0"/>
142 - <Group type="103" groupAlignment="0" max="-2" attributes="0">
143 - <Component id="passwordText" max="32767" attributes="1"/>
144 - <Component id="userText" max="32767" attributes="1"/>
145 - <Component id="portText" max="32767" attributes="1"/>
146 - <Component id="serverText" alignment="1" pref="136" max="32767" attributes="1"/>
147 - <Component id="connectButton" alignment="0" min="-2" max="-2" attributes="0"/>
148 - </Group>
149 - <EmptySpace max="32767" attributes="0"/>
150155 </Group>
151156 </Group>
152157 </DimensionLayout>
@@ -174,7 +179,9 @@
175180 </Group>
176181 <EmptySpace max="-2" attributes="0"/>
177182 <Component id="connectButton" min="-2" max="-2" attributes="0"/>
178 - <EmptySpace pref="53" max="32767" attributes="0"/>
 183+ <EmptySpace pref="17" max="32767" attributes="0"/>
 184+ <Component id="dbStatusLabel" min="-2" max="-2" attributes="0"/>
 185+ <EmptySpace max="-2" attributes="0"/>
179186 </Group>
180187 </Group>
181188 </DimensionLayout>
@@ -225,6 +232,11 @@
226233 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="connectButtonActionPerformed"/>
227234 </Events>
228235 </Component>
 236+ <Component class="javax.swing.JLabel" name="dbStatusLabel">
 237+ <Properties>
 238+ <Property name="text" type="java.lang.String" value="Not connected."/>
 239+ </Properties>
 240+ </Component>
229241 </SubComponents>
230242 </Container>
231243 <Container class="javax.swing.JPanel" name="schemaPanel">
@@ -239,27 +251,37 @@
240252 <Layout>
241253 <DimensionLayout dim="0">
242254 <Group type="103" groupAlignment="0" attributes="0">
243 - <Group type="102" attributes="0">
 255+ <Group type="102" alignment="0" attributes="0">
244256 <EmptySpace max="-2" attributes="0"/>
245257 <Group type="103" groupAlignment="0" attributes="0">
246 - <Group type="102" attributes="0">
247 - <Component id="prefixLabel" min="-2" max="-2" attributes="0"/>
 258+ <Group type="102" alignment="0" attributes="0">
 259+ <Component id="schemaStatusLabel" pref="260" max="32767" attributes="0"/>
248260 <EmptySpace max="-2" attributes="0"/>
249 - <Component id="prefixText" pref="90" max="32767" attributes="0"/>
250 - <EmptySpace pref="54" max="32767" attributes="0"/>
251261 </Group>
252262 <Group type="102" alignment="0" attributes="0">
253263 <Component id="schema15Radio" min="-2" max="-2" attributes="0"/>
254 - <EmptySpace pref="54" max="32767" attributes="0"/>
 264+ <EmptySpace pref="105" max="32767" attributes="0"/>
255265 </Group>
256266 <Group type="102" alignment="0" attributes="0">
257267 <Component id="schema14Radio" min="-2" max="-2" attributes="0"/>
258 - <EmptySpace pref="127" max="32767" attributes="0"/>
 268+ <EmptySpace pref="178" max="32767" attributes="0"/>
259269 </Group>
260270 <Group type="102" alignment="0" attributes="0">
261271 <Component id="schemaLabel" min="-2" max="-2" attributes="0"/>
262 - <EmptySpace pref="80" max="32767" attributes="0"/>
 272+ <EmptySpace pref="131" max="32767" attributes="0"/>
263273 </Group>
 274+ <Group type="102" alignment="0" attributes="0">
 275+ <Group type="103" groupAlignment="0" attributes="0">
 276+ <Component id="prefixLabel" alignment="0" min="-2" max="-2" attributes="0"/>
 277+ <Component id="dbnameLabel" alignment="0" min="-2" max="-2" attributes="0"/>
 278+ </Group>
 279+ <EmptySpace max="-2" attributes="0"/>
 280+ <Group type="103" groupAlignment="0" attributes="0">
 281+ <Component id="dbnameText" pref="90" max="32767" attributes="0"/>
 282+ <Component id="prefixText" alignment="0" pref="90" max="32767" attributes="0"/>
 283+ </Group>
 284+ <EmptySpace min="-2" pref="105" max="-2" attributes="0"/>
 285+ </Group>
264286 </Group>
265287 </Group>
266288 </Group>
@@ -278,7 +300,14 @@
279301 <Component id="prefixLabel" alignment="3" min="-2" max="-2" attributes="0"/>
280302 <Component id="prefixText" alignment="3" min="-2" max="-2" attributes="0"/>
281303 </Group>
282 - <EmptySpace pref="93" max="32767" attributes="0"/>
 304+ <EmptySpace max="-2" attributes="0"/>
 305+ <Group type="103" groupAlignment="3" attributes="0">
 306+ <Component id="dbnameLabel" alignment="3" min="-2" max="-2" attributes="0"/>
 307+ <Component id="dbnameText" alignment="3" min="-2" max="-2" attributes="0"/>
 308+ </Group>
 309+ <EmptySpace pref="27" max="32767" attributes="0"/>
 310+ <Component id="schemaStatusLabel" min="-2" max="-2" attributes="0"/>
 311+ <EmptySpace max="-2" attributes="0"/>
283312 </Group>
284313 </Group>
285314 </DimensionLayout>
@@ -291,6 +320,9 @@
292321 </Component>
293322 <Component class="javax.swing.JRadioButton" name="schema14Radio">
294323 <Properties>
 324+ <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
 325+ <ComponentRef name="schemaRadios"/>
 326+ </Property>
295327 <Property name="text" type="java.lang.String" value="1.4 (cur, old)"/>
296328 <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
297329 <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
@@ -304,6 +336,9 @@
305337 </Component>
306338 <Component class="javax.swing.JRadioButton" name="schema15Radio">
307339 <Properties>
 340+ <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
 341+ <ComponentRef name="schemaRadios"/>
 342+ </Property>
308343 <Property name="selected" type="boolean" value="true"/>
309344 <Property name="text" type="java.lang.String" value="1.5 (page, revision, text)"/>
310345 <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
@@ -323,6 +358,24 @@
324359 </Component>
325360 <Component class="javax.swing.JTextField" name="prefixText">
326361 </Component>
 362+ <Component class="javax.swing.JLabel" name="dbnameLabel">
 363+ <Properties>
 364+ <Property name="text" type="java.lang.String" value="Database"/>
 365+ </Properties>
 366+ </Component>
 367+ <Component class="javax.swing.JTextField" name="dbnameText">
 368+ <Properties>
 369+ <Property name="text" type="java.lang.String" value="wikidb"/>
 370+ </Properties>
 371+ <Events>
 372+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="dbnameTextActionPerformed"/>
 373+ </Events>
 374+ </Component>
 375+ <Component class="javax.swing.JLabel" name="schemaStatusLabel">
 376+ <Properties>
 377+ <Property name="text" type="java.lang.String" value="Not connected."/>
 378+ </Properties>
 379+ </Component>
327380 </SubComponents>
328381 </Container>
329382 <Container class="javax.swing.JPanel" name="progressPanel">
@@ -333,7 +386,7 @@
334387 <Group type="102" alignment="0" attributes="0">
335388 <EmptySpace max="-2" attributes="0"/>
336389 <Component id="progressLabel" min="-2" pref="383" max="-2" attributes="0"/>
337 - <EmptySpace max="32767" attributes="0"/>
 390+ <EmptySpace pref="46" max="32767" attributes="0"/>
338391 <Component id="startButton" min="-2" max="-2" attributes="0"/>
339392 <EmptySpace max="-2" attributes="0"/>
340393 </Group>
@@ -361,7 +414,6 @@
362415 <Component class="javax.swing.JButton" name="startButton">
363416 <Properties>
364417 <Property name="text" type="java.lang.String" value="Start import"/>
365 - <Property name="enabled" type="boolean" value="false"/>
366418 </Properties>
367419 <Events>
368420 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="startButtonActionPerformed"/>

Status & tagging log