Package net.sf.redmine_mylyn.api.model

Examples of net.sf.redmine_mylyn.api.model.User


    TableColumn idColumn = new TableColumn(table, SWT.NONE);
    TableColumn nameColumn = new TableColumn(table, SWT.NONE);
    TableColumn markerColumn = new TableColumn(table, SWT.NONE);
   
    for (String userId : getTaskAttribute().getValues()) {
      User user = users.getById(RedmineUtil.parseIntegerId(userId));
     
      if (user!=null) {
        TableItem item = new TableItem(table, SWT.NONE);
        item.setText(COLUMN_IDX_ID, userId);
        item.setText(COLUMN_IDX_NAME, RedmineUtil.formatUserPresentation(user.getLogin(), user.getName()));
      }
    }
   
    TaskAttribute addAttribute = getTaskAttribute().getAttribute(RedmineAttribute.WATCHERS_ADD.getTaskKey());
    if (addAttribute!=null) {
      for (String userId : addAttribute.getValues()) {
        User user = users.getById(RedmineUtil.parseIntegerId(userId));
       
        if (user!=null) {
          TableItem item = new TableItem(table, SWT.NONE);
          item.setText(COLUMN_IDX_ID, userId);
          item.setText(COLUMN_IDX_NAME, RedmineUtil.formatUserPresentation(user.getLogin(), user.getName()));
        }
      }
    }
   
    nameColumn.pack();
View Full Code Here


   
  }
 
  public void addWatcher(IRepositoryPerson person) {
    User user = users.getByLogin(person.getPersonId());
    TaskAttribute attribute = getTaskAttribute().getAttribute(RedmineAttribute.WATCHERS_ADD.getTaskKey());
    if (user!=null && attribute!=null) {
     
      String userId = ""+user.getId(); //$NON-NLS-1$
      if (!attribute.getValues().contains(userId) && !getTaskAttribute().getValues().contains(userId)) {
        attribute.addValue(userId);
       
        TableItem item = new TableItem(table, SWT.NONE);
        item.setText(COLUMN_IDX_ID, userId);
        item.setText(COLUMN_IDX_NAME, RedmineUtil.formatUserPresentation(user.getLogin(), user.getName()));
       
        updateMarker();
        attributeChanged();
      }
     
View Full Code Here

    lst.add(buildUser(3, "Dave", "Lopper", "Dave Lopper", "dlopper", "dlopper@somenet.foo"));
    lst.add(buildUser(4, "Robert", "Hill", "Robert Hill", "rhill", "rhill@somenet.foo"));
  }
 
  static User buildUser(int id, String fname, String lname, String name, String login, String mail) throws Exception {
    User user = new User();
    setId(user, id);
    user.setFirstname(fname);
    user.setLastname(lname);
    user.setName(name);
    user.setLogin(login);
    user.setMail(mail);
    return user;
  }
View Full Code Here

            taskAttribute.putOption(""+version.getId(), version.getName()); //$NON-NLS-1$
          }
          break;
        case USER:
          for( Member member : project.getMembers() ) {
            User user = configuration.getUsers().getById(member.getUserId());
            if (user != null) {
              taskAttribute.putOption(""+user.getId(), user.getName()); //$NON-NLS-1$
            }
          }
          break;
        default:
          for (String option : customField.getPossibleValues()) {
View Full Code Here

    this.configuration = configuration;
  }
 
  @Override
  public void setRepositoryPerson(TaskAttribute taskAttribute, IRepositoryPerson person) {
    User user = null;
   
    if (person.getPersonId()!=null && !person.getPersonId().isEmpty()) {
      user = configuration.getUsers().getByLogin(person.getPersonId());
      if (user==null && person.getPersonId().matches(IRedmineConstants.REGEX_INTEGER)) {
        user = configuration.getUsers().getById(RedmineUtil.parseIntegerId(person.getPersonId()));
      }
    }
   
    if(user!=null) {
      setValue(taskAttribute, ""+ user.getId()); //$NON-NLS-1$
    } else {
      setValue(taskAttribute, ""); //$NON-NLS-1$
    }
  }
View Full Code Here

    }
  }

  @Override
  public IRepositoryPerson getRepositoryPerson(TaskAttribute taskAttribute) {
    User user = null;
   
    if (!taskAttribute.getValue().isEmpty()) {
      if(RedmineUtil.isInteger(taskAttribute.getValue())) {
        user = configuration.getUsers().getById(RedmineUtil.parseIntegerId(taskAttribute.getValue()));
      }
     
      if (user==null) {
        user = configuration.getUsers().getByLogin(taskAttribute.getValue());
      }
     
      if (user!=null) {
        IRepositoryPerson person = getTaskRepository().createPerson(user.getLogin());
        person.setName(user.getName());
        return person;
      }
    }
   
    IRepositoryPerson person = super.getRepositoryPerson(taskAttribute);
View Full Code Here

@Override
public void setValue(TaskAttribute attribute, String value) {
 
  if (attribute.getMetaData().getKind()!=null && attribute.getMetaData().getKind().equals(TaskAttribute.KIND_PEOPLE)) {
    if (!value.isEmpty() && !value.matches(IRedmineConstants.REGEX_INTEGER)) {
      User user = configuration.getUsers().getByLogin(value);
      if(user!=null) {
        super.setValue(attribute, ""+user.getId()); //$NON-NLS-N$
        return;
      }
    }
  }
 
View Full Code Here

    if (proposals != null && !proposals.isEmpty()) {
      for (Entry<String, String> entry : proposals.entrySet()) {
       
        String name = entry.getValue();
        if (name!=null && !name.isEmpty()) {
          User user = null;
         
          if (configuration!=null && (user=configuration.getUsers().getById(RedmineUtil.parseIntegerId(entry.getKey())))!=null) {
            addressSet.add(RedmineUtil.formatUserPresentation(user.getLogin(), name));
          } else {
            addressSet.add(RedmineUtil.formatUserPresentation(entry.getKey(), name));
          }
        }
      }
View Full Code Here

TOP

Related Classes of net.sf.redmine_mylyn.api.model.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.