public void mousePressed(MouseEvent e) {
JXTable objectTable = getContainer().getObjectTable();
JXTable layoutTable = getContainer().getLayoutTable();
JXTable objectLayoutTable = getContainer().getObjectLayoutTable();
XTable objectViewTable = container.getObjectViewTable();
JTree tree = getContainer().getTree();
if ( (e.getSource().equals(objectTable)) && (e.getButton() == e.BUTTON3) ) {
//if (objectTable.getSelectedRows().length > 0)
//objectTable.removeRowSelectionInterval(0, objectTable.getRowCount() - 1);
if ( (objectTable.getRowCount() > 0) && (objectTable.rowAtPoint(e.getPoint()) != -1) )
objectTable.addRowSelectionInterval(objectTable.rowAtPoint(e.getPoint()), objectTable.rowAtPoint(e.getPoint()));
} else if ( (e.getSource().equals(tree)) && (e.getButton() == e.BUTTON3) ) {
tree.setSelectionRow(tree.getRowForLocation(e.getPoint().x, e.getPoint().y));
getContainer().updateTreePopupMenu();
} else if ( (e.getSource().equals(layoutTable)) && (e.getButton() == e.BUTTON3) ) {
if ( (layoutTable.getRowCount() > 0) && (layoutTable.rowAtPoint(e.getPoint()) != -1) ) {
if (layoutTable.getSelectedRows().length > 0)
layoutTable.removeRowSelectionInterval(0, layoutTable.getRowCount() - 1);
layoutTable.addRowSelectionInterval(layoutTable.rowAtPoint(e.getPoint()), layoutTable.rowAtPoint(e.getPoint()));
}
} else if ( (e.getSource().equals(objectLayoutTable)) && (e.getButton() == e.BUTTON3) ) {
if ( (objectLayoutTable.getRowCount() > 0) && (objectLayoutTable.rowAtPoint(e.getPoint()) != -1) ) {
if (objectLayoutTable.getSelectedRows().length > 0)
objectLayoutTable.removeRowSelectionInterval(0, objectLayoutTable.getRowCount() - 1);
objectLayoutTable.addRowSelectionInterval(objectLayoutTable.rowAtPoint(e.getPoint()), objectLayoutTable.rowAtPoint(e.getPoint()));
}
} else if (e.getSource().equals(objectViewTable) && (e.getButton() == e.BUTTON3)) {
CacheTableModel model = (CacheTableModel)objectViewTable.getTable().getModel();
if ( (!model.isNoRow()) && (objectViewTable.getTable().rowAtPoint(e.getPoint()) != -1) )
objectViewTable.getTable().addRowSelectionInterval(objectViewTable.getTable().rowAtPoint(e.getPoint()),
objectViewTable.getTable().rowAtPoint(e.getPoint()));
}
}