public CounterPartySelector(Statement statement, Statements statements, CounterParties counterParties) {
		super("Select Counterparty");
		this.statement = statement;
        this.counterParties = counterParties;
		oldCounterParty = null;
        newCounterParty = null;

        // COMPONENTS
		oldCounterPartyCombo = new JComboBox<BusinessObject>();
		oldCounterPartyCombo.addItem(null);
        for(BusinessObject counterParty : counterParties.getBusinessObjects()){
            oldCounterPartyCombo.addItem(counterParty);
        }
        oldCounterPartyCombo.setSelectedItem(null);
		oldCounterPartyCombo.addActionListener(this);
        oldCounterPartyCombo.setEnabled(false);
        newCounterPartyCombo = new JComboBox<BusinessObject>();
        newCounterPartyCombo.addItem(null);
        for(BusinessObject counterParty : counterParties.getBusinessObjects()){
            newCounterPartyCombo.addItem(counterParty);
        }
        newCounterPartyCombo.setSelectedItem(null);
        newCounterPartyCombo.addActionListener(this);

        ok = new JButton("Ok (Close popup)");
		ok.addActionListener(this);
		create = new JButton("Create Counterparty");
		create.addActionListener(this);
        //
        searchOptions = new SearchOptions();
        searchOptions.searchForCounterParty(null);
        searchOptions.searchForTransactionCode(statement.getTransactionCode());
        movementDataModel = new GenericStatementDataModel(searchOptions,
                statements);
        movementDataModel.setSingleStatement(statement);
        movementTable = new JTable(movementDataModel);
        movementTable.setDefaultRenderer(CounterParty.class, new ColorRenderer());
        movementTable.setDefaultRenderer(TmpCounterParty.class, new ColorRenderer());
        JScrollPane scrollPane = new JScrollPane(movementTable);
        //
        single = new JRadioButton("Single statement");
        multiple = new JRadioButton("Multiple movements");
        searchOnTransactionCode = new JCheckBox("TransactionCode == ");
        searchOnTransactionCode.setEnabled(false);
        searchOnTransactionCode.setSelected(true);
        searchOnTransactionCode.addActionListener(this);
        searchOnCommunication = new JCheckBox("Communication == ");
        searchOnCommunication.setEnabled(false);
        searchOnCommunication.addActionListener(this);
        transactionCode = new JTextField(10);
        transactionCode.setEnabled(false);
        transactionCode.setText(statement.getTransactionCode());
        transactionCode.getDocument().addDocumentListener(new DocumentListener() {
            public void changedUpdate(DocumentEvent e) {
                setTransactionCode();
            }
            public void insertUpdate(DocumentEvent e) {
                setTransactionCode();
            }
            public void removeUpdate(DocumentEvent e) {
                setTransactionCode();
            }
        });
        communication = new JTextField(10);
        communication.setEnabled(false);
        communication.setText(statement.getCommunication());
        communication.getDocument().addDocumentListener(new DocumentListener() {
            public void changedUpdate(DocumentEvent e) {
                setCommunication();
            }
            public void insertUpdate(DocumentEvent e) {
                setCommunication();
            }
            public void removeUpdate(DocumentEvent e) {
                setCommunication();
            }
        });
        searchOnCounterParty = new JCheckBox("Counterparty == ");
        searchOnCounterParty.setEnabled(false);
        searchOnCounterParty.setSelected(true);
        searchOnCounterParty.addActionListener(this);
        singleMultiple = new ButtonGroup();
        singleMultiple.add(single);
        singleMultiple.add(multiple);
        single.setSelected(true);
        single.addActionListener(this);
        multiple.addActionListener(this);
        apply = new JButton("Apply Changes");
        apply.addActionListener(this);
        apply.setEnabled(false);

        // Layout
        JPanel searchOptionsPanel = new JPanel(new GridLayout(0,2));
        searchOptionsPanel.add(single);
        searchOptionsPanel.add(multiple);
        searchOptionsPanel.add(searchOnTransactionCode);
        searchOptionsPanel.add(transactionCode);
        searchOptionsPanel.add(searchOnCommunication);
        searchOptionsPanel.add(communication);
        searchOptionsPanel.add(searchOnCounterParty);
        searchOptionsPanel.add(oldCounterPartyCombo);
        searchOptionsPanel.add(new JLabel("New Counterparty"));
        searchOptionsPanel.add(newCounterPartyCombo);
        searchOptionsPanel.add(apply);
        searchOptionsPanel.add(create);
        //
        JPanel contentPanel = new JPanel(new BorderLayout());
        contentPanel.add(searchOptionsPanel, BorderLayout.NORTH);
        contentPanel.add(scrollPane, BorderLayout.CENTER);
        contentPanel.add(ok, BorderLayout.SOUTH);
        setContentPane(contentPanel);
        pack();
    }