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

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


    return date;
  }

  private String toGitHubDate(TaskData taskData,
      GitHubTaskAttributes attr) {
    TaskAttribute attribute = taskData.getRoot().getAttribute(attr.name());
    String value = attribute==null?null:attribute.getValue();
    if (value != null) {
      try {
        Date d = dateFormat.parse(value);
        value = githubDateFormat.format(d);
      } catch (ParseException e) {
View Full Code Here


    return issue;
  }
 
  private String getAttributeValue(TaskData taskData,
      GitHubTaskAttributes attr) {
    TaskAttribute attribute = taskData.getRoot().getAttribute(attr.getId());
    return attribute==null?null:attribute.getValue();
  }
View Full Code Here

    TaskAttribute attribute = taskData.getRoot().getAttribute(attr.getId());
    return attribute==null?null:attribute.getValue();
  }

  private void createAttribute(TaskData data, GitHubTaskAttributes attribute, String value) {
    TaskAttribute attr = data.getRoot().createAttribute(attribute.getId());
    TaskAttributeMetaData metaData = attr.getMetaData();
    metaData.defaults()
      .setType(attribute.getType())
      .setKind(attribute.getKind())
      .setLabel(attribute.getLabel())
      .setReadOnly(attribute.isReadOnly());

    if (value != null) {
      attr.addValue(value);
    }
  }
View Full Code Here

      GitHubService service = connector.getService();
      GitHubCredentials credentials = GitHubCredentials.create(repository);
      if (taskData.isNew()) {
        issue = service.openIssue(user , repo, issue, credentials);
      } else {
        TaskAttribute operationAttribute = taskData.getRoot().getAttribute(TaskAttribute.OPERATION);
       
        GitHubTaskOperation operation = null;
       
       
        if (operationAttribute != null) {
          String opId = operationAttribute.getValue();
          operation = GitHubTaskOperation.fromId(opId);
         
        }
        if (operation != null && operation != GitHubTaskOperation.LEAVE) {
          service.editIssue(user , repo, issue, credentials);
View Full Code Here

    @Override
    public boolean initializeTaskData(TaskRepository repository, TaskData data,
            ITaskMapping initializationData, IProgressMonitor monitor) throws CoreException {

        createAttribute(data, GoogleCodeAttribute.TASK_KEY);
        TaskAttribute statusAttribute = createAttribute(data, GoogleCodeAttribute.STATUS, ATTRIBUTE_STATUS_DEFAULT);
        LabelUtils.fillStatusOptions(statusAttribute);

        createAttribute(data, GoogleCodeAttribute.SUMMARY);
       
        if (data.isNew()) {
            createAttribute(data, GoogleCodeAttribute.DESCRIPTION_NEW);
        } else {
            createAttribute(data, GoogleCodeAttribute.DESCRIPTION_EXISTING);
        }

        TaskAttribute typeAttribute = createAttribute(data, GoogleCodeAttribute.TYPE, ATTRIBUTE_TYPE_DEFAULT);
        LabelUtils.fillTypeOptions(typeAttribute);

        TaskAttribute priority = createAttribute(data, GoogleCodeAttribute.PRIORITY);
        LabelUtils.fillPriorityOptions(priority);

        createAttribute(data, GoogleCodeAttribute.MILESTONE);

        createAttribute(data, GoogleCodeAttribute.DATE_MODIFICATION);
View Full Code Here

        return true;
    }
   
    private TaskAttribute createAttribute(TaskData data, GoogleCodeAttribute key,
            String attributeDefault) {
        TaskAttribute attribute = createAttribute(data, key);
        attribute.setValue(attributeDefault);
        return attribute;
    }
View Full Code Here

        return createAttribute(data.getRoot(), key);
    }

    private static TaskAttribute createAttribute(TaskAttribute parent,
            GoogleCodeAttribute googleCodeAttribute) {
        TaskAttribute taskAttribute = parent.createAttribute(googleCodeAttribute.getKey());
        TaskAttributeMetaData metaData = taskAttribute.getMetaData();
        metaData.defaults();
        metaData.setReadOnly(googleCodeAttribute.isReadOnly());
        metaData.setKind(googleCodeAttribute.getKind());
        metaData.setLabel(googleCodeAttribute.getLabel());
        metaData.setType(googleCodeAttribute.getType());
View Full Code Here

            createBlockUpdate(newBlockon, false, updates);
        }
    }

    private List<String> getNewBlockedOn(TaskData taskData) {
        TaskAttribute blockedOnAttribute = getAttribute(taskData, GoogleCodeAttribute.BLOCKED_ON);
        List<String> newBlockedOns = taskData.getAttributeMapper().getValues(blockedOnAttribute);

        if (newBlockedOns != null && newBlockedOns.size() > 0) {
            String[] splittedIssueIds = newBlockedOns.get(0).split(",");
            newBlockedOns.clear();
View Full Code Here

        return newBlockedOns;
    }

    private List<String> getOldBlockedOn(TaskData taskData, Set<TaskAttribute> oldAttributes,
            List<String> newBlockedOns) {
        TaskAttribute oldBlockedOnAttribute = getOldAttribute(GoogleCodeAttribute.BLOCKED_ON,
                oldAttributes);

        List<String> oldBlockedOns = null;
        if (oldBlockedOnAttribute != null) {
            TaskAttributeMapper attributeMapper = taskData.getAttributeMapper();
View Full Code Here

        }
        return null;
    }

    private String getOldPriority(Set<TaskAttribute> oldAttributes) {
        TaskAttribute attribute = getOldAttribute(GoogleCodeAttribute.PRIORITY, oldAttributes);
        if (attribute != null) {
            return getPriority(attribute.getTaskData());
        } else {
            return null;
        }
    }
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.