()
| 176 | } |
| 177 | |
| 178 | private void setPhoto() { |
| 179 | try { |
| 180 | //itemsList.removeElement(endVCard); |
| 181 | itemsList.removeElement(noPhoto); |
| 182 | itemsList.removeElement(badFormat); |
| 183 | itemsList.removeElement(photoItem); |
| 184 | itemsList.removeElement(photoTooLarge); |
| 185 | |
| 186 | itemsList.removeElement(publish); |
| 187 | } catch (Exception e) { } |
| 188 | |
| 189 | if (vcard.hasPhoto) { |
| 190 | if (vcard.getPhoto().length==1) { |
| 191 | vcard.setPhoto(null); |
| 192 | itemsList.addElement(photoTooLarge); |
| 193 | } else { |
| 194 | try { |
| 195 | Image photoImg=Image.createImage(vcard.getPhoto(), 0,vcard.getPhoto().length); |
| 196 | photoItem=new ImageItem(photoImg, String.valueOf(vcard.getPhoto().length)+" bytes"); |
| 197 | itemsList.addElement(photoItem); |
| 198 | } catch (Exception e) { |
| 199 | itemsList.addElement(badFormat); |
| 200 | } |
| 201 | } |
| 202 | } else { |
| 203 | itemsList.addElement(noPhoto); |
| 204 | } |
| 205 | //itemsList.addElement(endVCard); |
| 206 | |
| 207 | itemsList.addElement(publish); |
| 208 | } |
| 209 | |
| 210 | public final void commandState() { |
| 211 | menuCommands.removeAllElements(); |
no test coverage detected