tableModel.setColumnIdentifiers(new String[] { "Name", "Value" });
tableModel.addTableModelListener(this);
// add a mouse listener to the table model for delete and insert rows.
MouseListener dataMouseListener = new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (rightClick(e.getModifiers())) {
dataModificationsPopup.show(e.getComponent(), e.getX(), e.getY());
}
}
};
setTableColumnWidths();
tablePanel = new JPanel();
tablePanel.setLayout(new BorderLayout());
tablePanel.add(table.getTableHeader(), BorderLayout.NORTH);
tablePanel.add(table, BorderLayout.CENTER);
table.addMouseListener(dataMouseListener);
mainPanel.add(tablePanel, BorderLayout.SOUTH);
JSplitPane contentPanel = null;
if (useConsole) {
String welcomeMessage = getWelcomeMessage();
bshConsole = new JConsole();
Interpreter interpreter = new Interpreter(bshConsole);
configureInterpreter(interpreter, cacheDelegate);
interpreter.println(welcomeMessage);
interpreter.setShowResults(!interpreter.getShowResults());// show() in beanShell
System.setOut(bshConsole.getOut());
System.setErr(bshConsole.getErr());
Thread t = new Thread(interpreter);
t.start();
contentPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, mainPanel, bshConsole);
getContentPane().add(contentPanel);
} else {
getContentPane().add(mainPanel);
}
jtree.addTreeSelectionListener(this);// REVISIT
MouseListener ml = new MouseAdapter() {
public void mouseClicked(final MouseEvent e) {
if (log.isTraceEnabled()) {
log.trace("clicked GUI");