Source Code Cross Referenced for JEditBug_746217.java in  » UML » jrefactory » msn » messages » commands » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » UML » jrefactory » msn.messages.commands 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package msn.messages.commands;
002:
003:        import javax.swing.*;
004:
005:        import msn.*;
006:        import msn.messages.*;
007:        import msn.util.*;
008:
009:        /**
010:         * (ADD) Adds a user to a list.
011:         *
012:         * @author     mace
013:         * @created    June 22, 2003
014:         * @modified   $Date: 2003/07/18 16:09:12 $ by $Author: mikeatkinson $
015:         * @version    $Revision: 1.1 $ modified $Date: 2003/07/18 16:09:12 $ by $Author: mikeatkinson $
016:         * @since      MSNP2
017:         */
018:        public class JEditBug_746217 extends StatefulCommand {
019:            private Contact contact;
020:
021:            public JEditBug_746217(MessagingClient client, String list,
022:                    Contact contact) {
023:                super (client, "ADD", list + " " + contact.getUserName() + " "
024:                        + contact.getNickName());
025:                this .contact = contact;
026:            }
027:
028:            public void processResponse(String[] parts) {
029:                String cmd = parts[0];
030:                if (cmd.equals("ADD")) {
031:                    processAdd(parts);
032:                } else if (cmd.equals("ILN")) {
033:                    processInitialStatus(parts);
034:                } else {
035:                    unknown(parts);
036:                }
037:            }
038:
039:            //{{{ processAdd()
040:            /**
041:             * (ADD) notice/confirmation that a user was added to a list.
042:             *
043:             * <code>ADD 21 {FL|RL|AL|BL} listVersion example@passport.com example@passport.com</code>
044:             *
045:             * @param parts  Description of the Parameter
046:             * @since        MSNP2
047:             */
048:            protected void processAdd(String[] parts) {
049:                String list = parts[2];
050:                ContactList cl;
051:                Contact contact = new Contact(parts[4], MSNUtilities
052:                        .decode(parts[5]));
053:                if (list.equals("FL")) {
054:                    cl = MSN.getInstance().getContactList();
055:                } else if (list.equals("RL")) {
056:                    if (MSN.getBooleanProperty(
057:                            PropertyManager.REVERSE_LIST_PROMPTING, false)) {
058:                        if (JOptionPane.YES_OPTION == JOptionPane
059:                                .showConfirmDialog(
060:                                        null,
061:                                        "Do you want to allow this user to send you messages?",
062:                                        contact + " added you",
063:                                        JOptionPane.YES_NO_OPTION,
064:                                        JOptionPane.QUESTION_MESSAGE)) {
065:                            client.send(new AddUser(client, "AL", contact));
066:                        } else {
067:                            client.send(new AddUser(client, "BL", contact));
068:                        }
069:                    } else {
070:                        client.send(new AddUser(client, "AL", contact));
071:                    }
072:                    cl = MSN.getInstance().getReverseList();
073:                } else if (list.equals("AL")) {
074:                    cl = MSN.getInstance().getAllowedList();
075:                } else if (list.equals("BL")) {
076:                    cl = MSN.getInstance().getBlockedList();
077:                } else {
078:                    unknown(parts);
079:                    return;
080:                }
081:                cl.addContact(contact);
082:                cl.sort();
083:            }//}}}
084:
085:            //{{{ processInitialStatus()
086:            /**
087:             * (ILN) A notification of the state of contacts when you first sign on.
088:             * One for each contact online is returned after your initial online status is set.
089:             * <P>
090:             * <code>ILN TrID {NLN|HDN|BSY|AWY|IDL|PHN|BRB|LUN} username nickname</code>
091:             * ex: <code>ILN 7 NLN bemace@hotmail.com Brad</code>
092:             *
093:             * @param parts  Description of the Parameter
094:             * @since        MSNP2
095:             */
096:            protected void processInitialStatus(String[] parts) {
097:                Contact c = MSN.getInstance().getContactList().getContact(
098:                        parts[3]);
099:                c.setStatus(parts[2]);
100:                c.setNickName(MSNUtilities.decode(parts[4]));
101:                c.notifyObservers();
102:            }//}}}
103:
104:            //{{{ processError()
105:            protected void processError(int error, int transactionID) {
106:                switch (error) {
107:                case MSNConstants.ERR_INVALID_PARAMETER:
108:                    System.out.println("Invalid username: "
109:                            + contact.getUserName());
110:                    break;
111:                default:
112:                    System.out.println("Error: " + error);
113:                }
114:            }//}}}
115:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.