public void mouseClicked(MouseEvent pEvent) {
            mLastMouseClickedPosition = pEvent.getPoint();
            Point p = pEvent.getComponent().getLocationOnScreen();
            mLastMouseClickedPosition.x += p.getX();
            mLastMouseClickedPosition.y += p.getY();
            TableViewAdapter adapter = (TableViewAdapter) getModel();
            mCurrentCollumn = adapter.getColumn(getColumnModel().getColumn(columnAtPoint(pEvent.getPoint())).getModelIndex());
            if (pEvent.getComponent().getCursor().getType() == Cursor.E_RESIZE_CURSOR) {
                if (pEvent.getClickCount() == 2) {
                    TableColumnModel model = getColumnModel();
                    JTableHeader header = getTableHeader();
                    int columnIndex = -1;
                    int length = Integer.MAX_VALUE;

                    for (int i = 0; i < model.getColumnCount(); i++) {
                        Rectangle rect = header.getHeaderRect(i);
                        int newLength = Math.abs(rect.x + rect.width - pEvent.getX());
                        if (newLength < length) {
                            columnIndex = i;
                            length = newLength;
                        }
                    }

                    autoSizeColumn(columnIndex);
                }
            }
            else if (pEvent.isMetaDown()) {
                mMenuItemSearch.setEnabled(mCurrentCollumn.isSearchable());
                mPopupMenu.pack();
                mPopupMenu.setLocation(mLastMouseClickedPosition);
                mPopupMenu.setVisible(true);
            }
            else if (pEvent.isControlDown() && mCurrentCollumn.isSearchable()) {
                menuItemSearchActionPerformed(null);
            }
            else if (mCurrentCollumn != null && mCurrentCollumn.isSortable()) {
                List selection = getSelectedRowObjects();
                adapter.sort(mCurrentCollumn);
                getTableHeader().repaint();
                addRowSelection(selection);
            }
        }