private void initTable(Grammar converted, UndoKeeper keeper) {
    final AutoProductionDataHelper helper = new AutoProductionDataHelper(converted, keeper);
    ProductionTableModel model =
        new ProductionTableModel(converted, keeper, helper) {
          public boolean isCellEditable(int row, int column) {
            return false;
          };
        };
    myTable = new ProductionTable(converted, keeper, true, model);

    myTable
        .getSelectionModel()
        .addListSelectionListener(
            new ListSelectionListener() {
              public void valueChanged(ListSelectionEvent e) {
                changeSelection();
              }
            });

    converted
        .getProductionSet()
        .addListener(
            new ChangeListener() {

              @Override
              public void stateChanged(ChangeEvent e) {
                if (e instanceof AddEvent) {
                  for (Object o : ((AddEvent) e).getToAdd()) {
                    Production p = (Production) o;
                    helper.add(getMaxRow(), new Object[] {p.getLHS(), null, p.getRHS()});
                  }
                }
              }
            });
  }
  private void changeSelection() {
    ListSelectionModel model = myTable.getSelectionModel();
    AutomatonEditorPanel<T, S> panel = getEditorPanel();
    panel.clearSelection();

    int min = model.getMinSelectionIndex(), max = model.getMaxSelectionIndex();
    if (min < 0) return;
    for (int i = min; i <= max; i++)
      if (model.isSelectedIndex(i) && myObjectMap.containsKey(i))
        panel.selectObject(myObjectMap.get(i));
  }