/** * Method getParticipant. * * @param aId - String * @return R4EParticipant */ protected R4EParticipant getParticipant(String aId) { // First check if the participant already exist in the participant list for (R4EParticipant tmpPart : fParticipants) { if (aId.equalsIgnoreCase(tmpPart.getId())) { return null; } } final R4EParticipant participant = RModelFactory.eINSTANCE.createR4EParticipant(); if (R4EUIModelController.isUserQueryAvailable()) { final IQueryUser query = new QueryUserFactory().getInstance(); try { final List<IUserInfo> users = query.searchByUserId(aId); // Fill info with first user returned for (IUserInfo user : users) { if (user.getUserId().toLowerCase().equals(aId)) { participant.setId(user.getUserId().toLowerCase()); participant.setEmail(user.getEmail()); fParticipantsDetailsValues.add(UIUtils.buildUserDetailsString(user)); return participant; } } } catch (NamingException e) { R4EUIPlugin.Ftracer.traceError("Exception: " + e.toString() + " (" + e.getMessage() + ")"); R4EUIPlugin.getDefault().logError("Exception: " + e.toString(), e); } catch (IOException e) { R4EUIPlugin.getDefault().logWarning("Exception: " + e.toString(), e); } } participant.setId(aId); fParticipantsDetailsValues.add(""); return participant; }
/** * Method addUserToParticipantList. * * @param aUserInfo - IUserInfo */ private void addUserToParticipantList(IUserInfo aUserInfo) { // First check if the participant already exist in the participant list for (R4EParticipant tmpPart : fParticipants) { if (aUserInfo.getUserId().equalsIgnoreCase(tmpPart.getId())) { return; } } // Add User to List final R4EParticipant participant = RModelFactory.eINSTANCE.createR4EParticipant(); participant.setId(aUserInfo.getUserId()); participant.setEmail(aUserInfo.getEmail()); fParticipantsDetailsValues.add(UIUtils.buildUserDetailsString(aUserInfo)); fParticipants.add(participant); updateComponents(participant); }