MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / ContactEdit

Method ContactEdit

src/main/java/Client/ContactEdit.java:67–175  ·  view source on GitHub ↗
(Contact c)

Source from the content-addressed store, hash-verified

65 private boolean newGroup;
66
67 public ContactEdit(Contact c) {
68 super(SR.MS_ADD_CONTACT);
69 cf = Config.getInstance();
70
71 tJid = new TextInput(SR.MS_USER_JID, null, null);
72
73 tNick = new TextInput(SR.MS_NAME, null, null);
74
75 tGroup = new TextInput(SR.MS_NEWGROUP, (c == null) ? "" : c.group.name, null);
76
77 tTranspList = new DropChoiceBox(SR.MS_TRANSPORT);
78 // Transport droplist
79 tTranspList.add(sd.account.JID.getServer());
80 for (Enumeration e = sd.roster.hContacts.elements(); e.hasMoreElements();) {
81 Contact ct = (Contact) e.nextElement();
82 Jid transpJid = ct.jid;
83 if (JidUtils.isTransport(transpJid)) {
84 tTranspList.add(transpJid.getBare());
85 }
86 }
87 tTranspList.add(SR.MS_OTHER);
88 tTranspList.setSelectedIndex(tTranspList.size() - 1);
89
90 tAskSubscrCheckBox = new CheckBox(SR.MS_ASK_SUBSCRIPTION, false);
91
92 try {
93 String jid;
94//#ifndef WMUC
95 if (c instanceof MucContact) {
96 jid = ((MucContact) c).realJid.getBare();
97 } else {
98//#endif
99 jid = c.jid.getBare();
100//#ifndef WMUC
101 }
102//#endif
103 // edit contact
104 tJid.setValue(jid);
105 tNick.setValue(c.nick);
106//#ifndef WMUC
107 if (c instanceof MucContact) {
108 c = null;
109 throw new Exception();
110 }
111//#endif
112 if (c.getGroupType() != Groups.TYPE_NOT_IN_LIST && c.getGroupType() != Groups.TYPE_SEARCH_RESULT) {
113 // edit contact
114 mainbar.setElementAt(jid, 0);
115 newContact = false;
116 } else {
117 c = null; // adding not-in-list
118 }
119 } catch (Exception e) {
120 c = null;
121 } // if MucContact does not contains realJid
122
123 int sel = -1;
124 ngroups = 0;

Callers

nothing calls this directly

Calls 15

getInstanceMethod · 0.95
isTransportMethod · 0.95
getBareMethod · 0.95
getServerMethod · 0.80
elementsMethod · 0.80
setSelectedIndexMethod · 0.80
getGroupTypeMethod · 0.80
setElementAtMethod · 0.80
getRosterGroupNamesMethod · 0.80
addElementMethod · 0.80
moveCursorToMethod · 0.80
getNextSelectableRefMethod · 0.80

Tested by

no test coverage detected