MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / VCardView

Method VCardView

src/main/java/VCard/VCardView.java:89–155  ·  view source on GitHub ↗

Creates a new instance of VCardView @param contact

(Contact contact)

Source from the content-addressed store, hash-verified

87 * @param contact
88 */
89 public VCardView(Contact contact) {
90 super(contact.getNickJid(), false);
91 this.vcard = contact.vcard;
92 this.c = contact;
93
94 refresh=new LinkString(SR.MS_REFRESH) {
95 public void doAction() {
96 VCard.request(vcard.getJid(), vcard.getId().substring(5));
97 destroyView();
98 }
99 };
100
101 if (vcard == null || vcard.isEmpty()) {
102 itemsList.addElement(noVCard);
103 itemsList.addElement(refresh);
104 } else {
105 setPhoto();
106 for (int index=0; index<vcard.getCount(); index++) {
107 String data=vcard.getVCardData(index);
108 String name=(String)VCard.vCardLabels.elementAt(index);
109 if (data!=null && name!=null) {
110 if (!VCard.vCardFields.elementAt(index).equals("URL")) {
111 MultiLine nData=new MultiLine(name, data);
112 nData.selectable=true;
113 itemsList.addElement(nData);
114//#ifdef CLIPBOARD
115 VCardData.append(name).append(":\n").append(data).append("\n");
116//#endif
117 } else {
118 url=data;
119 LinkString nData = new LinkString(url) {
120 public void doAction() {
121 BombusMod.getInstance().platformRequest(url);
122 }
123 };
124 itemsList.addElement(nData);
125 }
126 }
127 }
128 itemsList.addElement(endVCard);
129 itemsList.addElement(new SpacerItem(10));
130 itemsList.addElement(refresh);
131//#ifdef CLIPBOARD
132 copy = new LinkString(SR.MS_COPY + " " + SR.MS_VCARD) {
133
134 public void doAction() {
135 ClipBoardIO.getInstance().setClipBoard(VCardData.toString());
136 destroyView();
137 }
138 };
139 itemsList.addElement(copy);
140
141//#endif
142//#ifdef FILE_IO
143 if (vcard.hasPhoto) {
144 save = new LinkString(SR.MS_SAVE_PHOTO) {
145
146 public void doAction() {

Callers

nothing calls this directly

Calls 9

setPhotoMethod · 0.95
getNickJidMethod · 0.80
addElementMethod · 0.80
getVCardDataMethod · 0.80
appendMethod · 0.80
isEmptyMethod · 0.45
getCountMethod · 0.45
equalsMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected