public void actionPerformed(ActionEvent ae) {

        //
        // Process the action command
        //
        // "new" - Add a price history element
        // "delete" - Delete a price history element
        // "done" - All done
        //
        try {
            String action = ae.getActionCommand();
            if (action.equals("new")) {
                PriceHistoryEditDialog.showDialog(this, security, tableModel);
                createChartData();
                chart.chartModified();
            } else if (action.equals("delete")) {
                int[] rows = table.getSelectedRows();
                if (rows.length == 0) {
                    JOptionPane.showMessageDialog(this, "You must select an entry to delete",
                                                  "Error", JOptionPane.ERROR_MESSAGE);
                } else {
                    for (int row : rows) {
                        PriceHistory ph = tableModel.getEntryAt(row);
                        SortedSet<PriceHistory> s = security.getPriceHistory();
                        s.remove(ph);
                    }
                    
                    tableModel.priceHistoryChanged();
                    createChartData();
                    chart.chartModified();
                    Main.dataModified = true;
                }
            } else if (action.equals("done")) {
                setVisible(false);
                dispose();
            }
        } catch (Exception exc) {
            Main.logException("Exception while processing action event", exc);
        }
    }