return;
}
DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
Object userObject = node.getUserObject();
if (userObject instanceof Table) {
final Table table = (Table) userObject;
int button = e.getButton();
if (button == MouseEvent.BUTTON1 && e.getClickCount() == 2) {
// double click = add table
addTable(table);
} else if (button == MouseEvent.BUTTON2 || button == MouseEvent.BUTTON3) {
// right click = open popup menu
boolean enableAddTable = false;
boolean enableRemoveTable = false;
final Column[] columns = table.getColumns();
for (Column column : columns) {
if (_analysisJobBuilder.containsSourceColumn(column)) {
enableRemoveTable = true;
} else {
enableAddTable = true;
}
if (enableAddTable && enableRemoveTable) {
break;
}
}
final JPopupMenu popup = new JPopupMenu();
popup.setLabel(table.getName());
if (enableAddTable) {
final JMenuItem addTableItem = WidgetFactory.createMenuItem("Add table to source",
"images/actions/toggle-source-table.png");
addTableItem.addActionListener(new ActionListener() {