panel.add("North", inputPanel);
}
{ // TextArea to show query results
queryOutput = new TextArea();
queryOutput.setEditable(false);
panel.add("South", queryOutput);
}
gbc.gridx=offset; gbc.gridy=1; gbc.gridwidth=3; gbc.gridheight=1;
add(panel, gbc);
}
// Checkboxes for log levels
gbc.gridx=0; gbc.gridy=2; gbc.gridwidth=1; gbc.gridheight=1;
add(new Label("Choose Logging Level: "), gbc);
gbc.gridx=1; gbc.gridwidth=3; gbc.gridheight=1;
add(createLogLevelBoxes(), gbc);
// Clear logging output - Button
clearLogButton = new Button("Clear Log Window");
class ClearListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
logOutput.setText("");
}
}
clearLogButton.addActionListener(new ClearListener());
gbc.gridx=4; gbc.gridy=2; gbc.gridwidth=1; gbc.gridheight=1;
gbc.weightx = gbc.weighty = 0.0;
add(clearLogButton, gbc);
// Dump internal state - Button
dumpButton = new Button("Dump State");
class DumpListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
// logOutput.setText(""); // clear log window
try {
log.info("Dump start");
I_Authenticate auth = xmlBlasterMain.getAuthenticate();
StringBuffer buf = new StringBuffer(auth.toXml());
buf.append(xmlBlasterMain.getXmlBlaster().toXml());
LogRecord record = new LogRecord(Level.INFO, buf.toString());
log(record);
log.info("Dump end");
}
catch(XmlBlasterException ee) {
log.severe("Sorry, dump failed: " + ee.getMessage());
}
}
}
dumpButton.addActionListener(new DumpListener());
gbc.gridx=5; gbc.gridy=2; gbc.gridwidth=1; gbc.gridheight=1;
gbc.weightx = gbc.weighty = 0.0;
add(dumpButton, gbc);
// TextArea for log outputs
gbc.gridx=0; gbc.gridy=3; gbc.gridwidth=6; gbc.gridheight=6;
gbc.weightx = gbc.weighty = 1.0;
logOutput = new TextArea("", 30, 100); // set rows here (width 100 is ignored)
logOutput.setEditable(false);
add(logOutput, gbc);
pack();