@@ -0,0 +1,3384 @@
+/*%0A * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.%0A *%0A * Distributable under LGPL license.%0A * See terms of license at gnu.org.%0A */%0Apackage net.java.sip.communicator.impl.gui.main.contactlist.addcontact;%0A%0Aimport java.awt.BorderLayout;%0Aimport java.awt.FlowLayout;%0Aimport java.awt.event.ActionEvent;%0Aimport java.awt.event.ActionListener;%0A%0Aimport javax.swing.BorderFactory;%0Aimport javax.swing.JButton;%0Aimport javax.swing.JDialog;%0Aimport javax.swing.JPanel;%0A%0Aimport net.java.sip.communicator.impl.gui.main.i18n.Messages;%0Aimport net.java.sip.communicator.service.contactlist.MetaContact;%0Aimport net.java.sip.communicator.service.contactlist.MetaContactGroup;%0Aimport net.java.sip.communicator.service.contactlist.MetaContactListService;%0Aimport net.java.sip.communicator.service.protocol.ProtocolProviderService;%0A%0Apublic class AddContactDialog extends JDialog%0A    implements ActionListener %7B%0A%0A    private AddContactPanel addContactPanel = new AddContactPanel();%0A    %0A    private JButton addButton = new JButton(Messages.getString(%22add%22));%0A    %0A    private JButton cancelButton = new JButton(Messages.getString(%22cancel%22));%0A    %0A    private JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));%0A    %0A    private JPanel mainPanel = new JPanel(new BorderLayout());%0A    %0A    private MetaContactListService clist;%0A    %0A    private MetaContact metaContact;%0A    %0A    private MetaContactGroup group;%0A    %0A    private ProtocolProviderService pps;%0A    %0A    public AddContactDialog(MetaContactListService clist,%0A            MetaContact metaContact,%0A            ProtocolProviderService pps) %7B%0A        %0A        this.clist = clist;%0A        this.metaContact = metaContact;%0A        this.pps = pps;%0A        %0A        this.init();%0A    %7D%0A    %0A    public AddContactDialog(MetaContactListService clist,%0A            MetaContactGroup group,%0A            ProtocolProviderService pps) %7B%0A        %0A        this.clist = clist;%0A        this.group = group;%0A        this.pps = pps;%0A        %0A        this.init();%0A    %7D%0A%0A    private void init() %7B%0A        this.setTitle(Messages.getString(%22addContact%22));%0A        %0A        this.setSize(520, 250);%0A        %0A        this.setModal(true);%0A        %0A        this.addButton.setName(%22add%22);%0A        this.cancelButton.setName(%22cancel%22);%0A        %0A        this.addButton.addActionListener(this);%0A        this.cancelButton.addActionListener(this);%0A        %0A        this.buttonsPanel.add(addButton);%0A        this.buttonsPanel.add(cancelButton);%0A        %0A        this.mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 0, 10));%0A        %0A        this.mainPanel.add(addContactPanel, BorderLayout.CENTER);%0A        this.mainPanel.add(buttonsPanel, BorderLayout.SOUTH);%0A        %0A        this.getContentPane().add(mainPanel);%0A    %7D%0A    %0A    public void actionPerformed(ActionEvent e) %7B%0A        JButton button = (JButton)e.getSource();%0A        String name = button.getName();%0A        %0A        if (name.equals(%22add%22)) %7B%0A            if (metaContact != null) %7B%0A                this.clist.addNewContactToMetaContact(pps, metaContact,%0A                    addContactPanel.getUIN());%0A            %7D%0A            else if (group != null) %7B%0A                this.clist.createMetaContact(%0A                        pps, group, addContactPanel.getUIN());%0A            %7D%0A            this.dispose();%0A        %7D%0A        else %7B%0A            this.dispose();%0A        %7D%0A    %7D%0A%7D%0A

add contact dialog