Package com.valhalla.gui

Examples of com.valhalla.gui.NMOptionListener


                    d.addButton("Yes", 1);
                    d.addButton("No", 2);
                    d.setVisible(true);

                    d.addOptionListener(
                        new NMOptionListener() {
                            public void buttonClicked(int num) {
                                currentlyRequesting.remove(userId);
                                if (num == 1) {
                                    Presence packet = new Presence(
                                            Presence.Type.SUBSCRIBED);
                                    packet.setTo(userId);

                                    BuddyList.getInstance().getConnection().sendPacket(
                                            packet);
                                    BuddyStatus buddy = BuddyList.getInstance()
                                            .getBuddyStatus(userId);
                                    buddy.setRemoved(false);
                                }

                                boolean add = true;
                                // find out if they are already in the roster
                                if (ConnectorThread.getInstance().getRoster()
                                        .contains(userId.toLowerCase())) {
                                    add = false;
                                }
                                if (userId.indexOf("@") < 0) {
                                    add = false;
                                }

                                if (add) {
                                    NMOptionDialog di = new NMOptionDialog(
                                            (JFrame) null, resources.getString("addButton"),
                                            MessageFormat.format(resources.getString("doAddBuddy"),
                                            new Object[]{userId}),
                                            NMOptionDialog.QUESTION);

                                    di.addButton("Yes", 1);
                                    di.addButton("No", 2);
                                    di.setVisible(true);

                                    di.addOptionListener(
                                        new NMOptionListener() {
                                            public void buttonClicked(int num) {
                                                if (num == 1) {
                                                    AddBuddyDialog dialog = new AddBuddyDialog();
                                                    dialog.setBuddyId(userId);
                                                    dialog.setVisible(true);
View Full Code Here


                NMOptionDialog dialog = new NMOptionDialog((JFrame) null,
                        resources.getString("invitationReceived"), message);

                dialog.addButton("Yes", 1);
                dialog.addButton("No", 2);
                dialog.addOptionListener(new NMOptionListener() {
                    public void buttonClicked(int num) {
                        inviteHandler(num, connection, room, inviter, reason,
                                password);
                    }
                });
View Full Code Here

TOP

Related Classes of com.valhalla.gui.NMOptionListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.