Package org.eclipse.mylyn.tasks.core.data

Examples of org.eclipse.mylyn.tasks.core.data.TaskAttribute


    return repositoryUrl + IRedmineConstants.REDMINE_URL_TICKET + taskId;
  }

  @Override
  public boolean hasTaskChanged(TaskRepository taskRepository, ITask task, TaskData taskData) {
    TaskAttribute attribute = taskData.getRoot().getMappedAttribute(RedmineAttribute.DATE_UPDATED.getTaskKey());
    String repositoryDate = attribute.getValue();
    Date localeDate = task.getModificationDate();
    if (localeDate!=null) {
      //repo > local => 1
      return RedmineUtil.parseDate(repositoryDate).compareTo(localeDate)>0;
    }
View Full Code Here


   
    Configuration configuration = getRepositoryConfiguration(taskRepository);
    Assert.isNotNull(configuration);
   
    //Set CompletionDate, if Closed-Status
    TaskAttribute attribute = taskData.getRoot().getMappedAttribute(RedmineAttribute.STATUS.getTaskKey());
    IssueStatus issueStatus = configuration.getIssueStatuses().getById(RedmineUtil.parseIntegerId(attribute.getValue()));
    if(issueStatus==null) {
      IStatus status = new Status(IStatus.ERROR, RedmineCorePlugin.PLUGIN_ID, Messages.ERRMSG_MISSING_ISSUE_STATUS+attribute.getValue());
      StatusHandler.log(status);
    } else {
      if(issueStatus.isClosed()) {
        Date date = task.getCompletionDate();
        attribute =  taskData.getRoot().getMappedAttribute(RedmineAttribute.DATE_UPDATED.getTaskKey());
        try {
          date = new Date(Long.parseLong(attribute.getValue()));
        } catch(NumberFormatException e) {
          IStatus status = RedmineCorePlugin.toStatus(e, Messages.ERRMSG_INVALID_TIMESTAMP_X, attribute.getValue());
          StatusHandler.log(status);
          date = new Date(0);
        }
        task.setCompletionDate(date);
      } else {
View Full Code Here

  @Override
  public Collection<TaskRelation> getTaskRelations(TaskData taskData) {

    Collection<TaskRelation> relations = null;
   
    TaskAttribute parentAttribute = taskData.getRoot().getAttribute(RedmineAttribute.PARENT.getTaskKey());
    if (parentAttribute!=null && !parentAttribute.getValue().isEmpty()) {
     
      relations = new ArrayList<TaskRelation>(1);
      relations.add(TaskRelation.parentTask(parentAttribute.getValue()));
    }
   
    TaskAttribute subtaskAttribute = taskData.getRoot().getAttribute(RedmineAttribute.SUBTASKS.getTaskKey());
    if (subtaskAttribute!=null && subtaskAttribute.getValues().size()>0) {
      if (relations==null) {
        relations = new ArrayList<TaskRelation>();
      }
     
      for(String stringVal : subtaskAttribute.getValues()) {
        relations.add(TaskRelation.subtask(stringVal));
      }
    }
   
    return relations;
View Full Code Here

   
    //operation
  }
 
  void setAttributeValue(TaskAttribute root, RedmineAttribute redmineAttribute, String value) {
    TaskAttribute attribute = root.getAttribute(redmineAttribute.getTaskKey());
    if(attribute!=null && value!=null) {
      attribute.setValue(value);
    }
  }
View Full Code Here

      attribute.setValue(value);
    }
  }

  void setAttributeValue(TaskAttribute root, RedmineAttribute redmineAttribute, Date value) {
    TaskAttribute attribute = root.getAttribute(redmineAttribute.getTaskKey());
    if(attribute!=null && value!=null) {
      attribute.setValue(""+value.getTime());
    }
  }
View Full Code Here

      attribute.setValue(""+value.getTime());
    }
  }

  void setAttributeValue(TaskAttribute root, RedmineAttribute redmineAttribute, int value) {
    TaskAttribute attribute = root.getAttribute(redmineAttribute.getTaskKey());
    if(attribute!=null) {
      attribute.setValue(""+value);
    }
  }
View Full Code Here

      attribute.setValue(""+value);
    }
  }

  void setAttributeValue(TaskAttribute root, RedmineAttribute redmineAttribute, float value) {
    TaskAttribute attribute = root.getAttribute(redmineAttribute.getTaskKey());
    if(attribute!=null) {
      attribute.setValue(""+value);
    }
  }
View Full Code Here

 
 
  private boolean isPartial(TaskData data) {
    for (GitHubTaskAttributes attribute: GitHubTaskAttributes.values()) {
      if (attribute.isRequiredForFullTaskData()) {
        TaskAttribute taskAttribute = data.getRoot().getAttribute(attribute.getId());
        if (taskAttribute == null) {
          return true;
        }
      }
    }
View Full Code Here

    }
    return false;
  }

  private void createOperations(TaskData data, GitHubIssue issue) {
    TaskAttribute operationAttribute = data.getRoot().createAttribute(TaskAttribute.OPERATION);
    operationAttribute.getMetaData().setType(TaskAttribute.TYPE_OPERATION);
   
    if (!data.isNew()) {
      if (issue.getState() != null) {
        addOperation(data,issue,GitHubTaskOperation.LEAVE,true);
        if (issue.getState().equals("open")) {
View Full Code Here

      }
    }
  }

  private void addOperation(TaskData data, GitHubIssue issue, GitHubTaskOperation operation,boolean asDefault) {
    TaskAttribute attribute = data.getRoot().createAttribute(TaskAttribute.PREFIX_OPERATION + operation.getId());
    String label = createOperationLabel(issue, operation);
    TaskOperation.applyTo(attribute, operation.getId(), label);
   
    if (asDefault) {
      TaskAttribute operationAttribute = data.getRoot().getAttribute(TaskAttribute.OPERATION);
      TaskOperation.applyTo(operationAttribute, operation.getId(), label);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.mylyn.tasks.core.data.TaskAttribute

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.