org.eclipse.mylyn.tasks.core_3.7.1.v20120425-0100

16:46:52.175 INFO  jd.cli.Main - Decompiling org.eclipse.mylyn.tasks.core_3.7.1.v20120425-0100.jar
package org.eclipse.mylyn.tasks.core.data;

import java.util.Map;

public class TaskAttributeMetaData
{
  private final TaskAttribute taskAttribute;
  
  TaskAttributeMetaData(TaskAttribute taskAttribute)
  {
    this.taskAttribute = taskAttribute;
  }
  
  public TaskAttributeMetaData defaults()
  {
    setLabel(null);
    setKind(null);
    setReadOnly(true);
    setType("shortText");
    
    return this;
  }
  
  public TaskAttributeMetaData clear()
  {
    taskAttribute.clearMetaDataMap();
    return this;
  }
  
  @Deprecated
  public String getDefaultOption()
  {
    return taskAttribute.getMetaDatum("task.meta.defaultOption");
  }
  
  public String getKind()
  {
    return taskAttribute.getMetaDatum("task.meta.attributeKind");
  }
  
  public String getLabel()
  {
    return taskAttribute.getMetaDatum("task.meta.label");
  }
  
  public String getType()
  {
    return taskAttribute.getMetaDatum("task.meta.type");
  }
  
  public String getValue(String key)
  {
    return taskAttribute.getMetaDatum(key);
  }
  
  public Map<String, String> getValues()
  {
    return taskAttribute.getMetaDataMap();
  }
  
  public boolean isDisabled()
  {
    return Boolean.parseBoolean(taskAttribute.getMetaDatum("task.meta.disabled"));
  }
  
  public boolean isReadOnly()
  {
    return Boolean.parseBoolean(taskAttribute.getMetaDatum("task.meta.readOnly"));
  }
  
  public TaskAttributeMetaData putValue(String key, String value)
  {
    taskAttribute.putMetaDatum(key, value);
    return this;
  }
  
  @Deprecated
  public TaskAttributeMetaData setDefaultOption(String defaultOption)
  {
    if (defaultOption != null) {
      taskAttribute.putMetaDatum("task.meta.defaultOption", defaultOption);
    } else {
      taskAttribute.removeMetaDatum("task.meta.defaultOption");
    }
    return this;
  }
  
  public TaskAttributeMetaData setKind(String value)
  {
    if (value != null) {
      taskAttribute.putMetaDatum("task.meta.attributeKind", value);
    } else {
      taskAttribute.removeMetaDatum("task.meta.attributeKind");
    }
    return this;
  }
  
  public TaskAttributeMetaData setLabel(String value)
  {
    if (value != null) {
      taskAttribute.putMetaDatum("task.meta.label", value);
    } else {
      taskAttribute.removeMetaDatum("task.meta.label");
    }
    return this;
  }
  
  public TaskAttributeMetaData setReadOnly(boolean value)
  {
    taskAttribute.putMetaDatum("task.meta.readOnly", Boolean.toString(value));
    return this;
  }
  
  public TaskAttributeMetaData setType(String value)
  {
    if (value != null) {
      taskAttribute.putMetaDatum("task.meta.type", value);
    } else {
      taskAttribute.removeMetaDatum("task.meta.type");
    }
    return this;
  }
  
  public TaskAttributeMetaData setDisabled(boolean value)
  {
    taskAttribute.putMetaDatum("task.meta.disabled", Boolean.toString(value));
    return this;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.core.data.TaskAttributeMetaData
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.core.data;

import java.io.InputStream;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;

public abstract class AbstractTaskAttachmentSource
{
  public abstract InputStream createInputStream(IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract boolean isLocal();
  
  public abstract long getLength();
  
  public abstract String getName();
  
  public abstract String getContentType();
  
  public abstract String getDescription();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentSource
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.core.data;

import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.TaskRepository;

public class TaskAttachmentModel
{
  private boolean attachContext;
  private final TaskAttribute attribute;
  private String comment;
  private AbstractTaskAttachmentSource source;
  private final ITask task;
  private final TaskRepository taskRepository;
  private String contentType;
  
  public TaskAttachmentModel(TaskRepository taskRepository, ITask task, TaskAttribute attribute)
  {
    this.taskRepository = taskRepository;
    this.task = task;
    this.attribute = attribute;
  }
  
  public boolean getAttachContext()
  {
    return attachContext;
  }
  
  public TaskAttribute getAttribute()
  {
    return attribute;
  }
  
  public String getComment()
  {
    return comment;
  }
  
  public AbstractTaskAttachmentSource getSource()
  {
    return source;
  }
  
  public ITask getTask()
  {
    return task;
  }
  
  public TaskRepository getTaskRepository()
  {
    return taskRepository;
  }
  
  public void setAttachContext(boolean attachContext)
  {
    this.attachContext = attachContext;
  }
  
  public void setComment(String comment)
  {
    this.comment = comment;
  }
  
  public void setSource(AbstractTaskAttachmentSource source)
  {
    this.source = source;
  }
  
  public String getContentType()
  {
    if ((contentType == null) && (getSource() != null)) {
      return getSource().getContentType();
    }
    return contentType;
  }
  
  public void setContentType(String contentType)
  {
    this.contentType = contentType;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.core.data.TaskAttachmentModel
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.core.data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.eclipse.core.runtime.Assert;
import org.eclipse.mylyn.tasks.core.IRepositoryPerson;

public class TaskRevision
{
  private final IRepositoryPerson author;
  private final List<Change> changes;
  private final Date date;
  private final String id;
  
  public static class Change
  {
    private final String added;
    private final String attributeId;
    private final String field;
    private final String removed;
    
    public Change(String attributeId, String field, String removed, String added)
    {
      Assert.isNotNull(attributeId);
      Assert.isNotNull(field);
      this.attributeId = attributeId;
      this.field = field;
      this.removed = removed;
      this.added = added;
    }
    
    public String getAdded()
    {
      return added;
    }
    
    public String getAttributeId()
    {
      return attributeId;
    }
    
    public String getField()
    {
      return field;
    }
    
    public String getRemoved()
    {
      return removed;
    }
  }
  
  public TaskRevision(String id, Date date, IRepositoryPerson author)
  {
    Assert.isNotNull(id);
    this.id = id;
    this.date = date;
    this.author = author;
    changes = new ArrayList();
  }
  
  public void add(Change change)
  {
    changes.add(change);
  }
  
  public IRepositoryPerson getAuthor()
  {
    return author;
  }
  
  public List<Change> getChanges()
  {
    return new ArrayList(changes);
  }
  
  public Date getDate()
  {
    return date;
  }
  
  public String getId()
  {
    return id;
  }
  
  public void remove(Change change)
  {
    changes.remove(change);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.core.data.TaskRevision
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.core.data;

import org.eclipse.mylyn.internal.tasks.core.data.Messages;

public final class DefaultTaskSchema
  extends AbstractTaskSchema
{
  private static final DefaultTaskSchema instance = new DefaultTaskSchema();
  
  public static AbstractTaskSchema.Field getField(String taskKey)
  {
    return instance.getFieldByKey(taskKey);
  }
  
  public static DefaultTaskSchema getInstance()
  {
    return instance;
  }
  
  public final AbstractTaskSchema.Field ADD_SELF_CC = 
    createField("task.common.addselfcc", Messages.DefaultTaskSchema_Add_Self_to_CC_Label, "boolean");
  public final AbstractTaskSchema.Field ATTACHMENT_AUTHOR = 
    createField("task.common.attachment.author", Messages.DefaultTaskSchema_Author_Label, "person");
  public final AbstractTaskSchema.Field ATTACHMENT_CONTENT_TYPE = 
    createField("task.common.attachment.ctype", Messages.DefaultTaskSchema_Content_Type_Label, "shortText");
  public final AbstractTaskSchema.Field ATTACHMENT_DATE = 
    createField("task.common.attachment.date", Messages.DefaultTaskSchema_Created_Label, "dateTime", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field ATTACHMENT_DESCRIPTION = 
    createField("task.common.attachment.description", Messages.DefaultTaskSchema_Description_Label, "shortRichText");
  public final AbstractTaskSchema.Field ATTACHMENT_FILENAME = 
    createField("filename", Messages.DefaultTaskSchema_Filename_Label, "shortText");
  public final AbstractTaskSchema.Field ATTACHMENT_ID = 
    createField("task.common.attachment.id", Messages.DefaultTaskSchema_ID_Label, "shortText", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field ATTACHMENT_IS_DEPRECATED = 
    createField("task.common.attachment.deprecated", Messages.DefaultTaskSchema_Deprecated_Label, "boolean");
  public final AbstractTaskSchema.Field ATTACHMENT_IS_PATCH = 
    createField("task.common.attachment.patch", Messages.DefaultTaskSchema_Patch_Label, "boolean");
  public final AbstractTaskSchema.Field ATTACHMENT_REPLACE_EXISTING = 
    createField("task.common.attachment.replaceExisting", Messages.DefaultTaskSchema_Replace_existing_attachment, "boolean");
  public final AbstractTaskSchema.Field ATTACHMENT_SIZE = 
    createField("task.common.attachment.size", Messages.DefaultTaskSchema_Size_Label, "long", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field ATTACHMENT_URL = 
    createField("task.common.attachment.url", Messages.DefaultTaskSchema_URL_Label, "url");
  public final AbstractTaskSchema.Field COMMENT_ATTACHMENT_ID = 
    createField("task.common.comment.attachment.id", Messages.DefaultTaskSchema_Attachment_ID_Label, "shortText", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field COMMENT_AUTHOR = 
    createField("task.common.comment.author", Messages.DefaultTaskSchema_Author_Label, "person", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field COMMENT_DATE = 
    createField("task.common.comment.date", Messages.DefaultTaskSchema_Created_Label, "dateTime", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field COMMENT_HAS_ATTACHMENT = 
    createField("task.common.comment.attachment", Messages.DefaultTaskSchema_Attachment_Label, "boolean", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field COMMENT_ISPRIVATE = 
    createField("task.common.comment.isprivate", Messages.DefaultTaskSchema_Private_Label, "boolean");
  public final AbstractTaskSchema.Field COMMENT_NUMBER = 
    createField("task.common.comment.number", Messages.DefaultTaskSchema_Number_Label, "integer", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field COMMENT_TEXT = 
    createField("task.common.comment.text", Messages.DefaultTaskSchema_Description_Label, "longRichText", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field COMMENT_URL = 
    createField("task.common.comment.url", Messages.DefaultTaskSchema_URL_Label, "url", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field COMPONENT = 
    createField("task.common.component", Messages.DefaultTaskSchema_Component_Label, "singleSelect", "component", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.ATTRIBUTE });
  public final AbstractTaskSchema.Field DATE_COMPLETION = 
    createField("task.common.date.completed", Messages.DefaultTaskSchema_Completion_Label, "date", "completion_date", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field DATE_CREATION = 
    createField("task.common.date.created", Messages.DefaultTaskSchema_Created_Label, "date", "creation_date", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field DATE_DUE = 
    createField("task.common.date.due", Messages.DefaultTaskSchema_Due_Label, "date", "due_date", new AbstractTaskSchema.Flag[0]);
  public final AbstractTaskSchema.Field DATE_MODIFICATION = 
    createField("task.common.date.modified", Messages.DefaultTaskSchema_Modified_Label, "date", "modification_date", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field DESCRIPTION = 
    createField("task.common.description", Messages.DefaultTaskSchema_Description_Label, "longRichText", "description", new AbstractTaskSchema.Flag[0]);
  public final AbstractTaskSchema.Field KEYWORDS = 
    createField("task.common.keywords", Messages.DefaultTaskSchema_Keywords_Label, "multiSelect", "keywords", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.ATTRIBUTE });
  public final AbstractTaskSchema.Field NEW_COMMENT = 
    createField("task.common.comment.new", Messages.DefaultTaskSchema_Rank_Label, "longRichText");
  public final AbstractTaskSchema.Field PRIORITY = 
    createField("task.common.priority", Messages.DefaultTaskSchema_Priority_Label, "singleSelect", "priority", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.ATTRIBUTE });
  public final AbstractTaskSchema.Field PRODUCT = 
    createField("task.common.product", Messages.DefaultTaskSchema_Product_Label, "singleSelect", "product", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.ATTRIBUTE });
  public final AbstractTaskSchema.Field RANK = 
    createField("task.common.rank", Messages.DefaultTaskSchema_Rank_Label, "integer", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field RESOLUTION = 
    createField("task.common.resolution", Messages.DefaultTaskSchema_Resolution_Label, "singleSelect", "resolution", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field SEVERITY = 
    createField("task.common.severity", Messages.DefaultTaskSchema_Severity_Label, "singleSelect", "severity", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.ATTRIBUTE });
  public final AbstractTaskSchema.Field STATUS = 
    createField("task.common.status", Messages.DefaultTaskSchema_Status_Label, "shortText", "status", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field SUMMARY = 
    createField("task.common.summary", Messages.DefaultTaskSchema_Summary_Label, "shortRichText", "summary", new AbstractTaskSchema.Flag[0]);
  public final AbstractTaskSchema.Field TASK_KEY = 
    createField("task.common.key", Messages.DefaultTaskSchema_Key_Label, "shortText", "task_key", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field TASK_KIND = 
    createField("task.common.kind", Messages.DefaultTaskSchema_Kind_Label, "singleSelect", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.ATTRIBUTE });
  public final AbstractTaskSchema.Field USER_ASSIGNED = 
    createField("task.common.user.assigned", Messages.DefaultTaskSchema_Owner_Label, "person", "assignee", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.PEOPLE });
  public final AbstractTaskSchema.Field USER_REPORTER = 
  
    createField("task.common.user.reporter", Messages.DefaultTaskSchema_Reporter_Label, "person", "reporter", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.PEOPLE, AbstractTaskSchema.Flag.READ_ONLY });
  public final AbstractTaskSchema.Field TASK_URL = 
    createField("task.common.url", Messages.DefaultTaskSchema_URL_Label, "url", new AbstractTaskSchema.Flag[] { AbstractTaskSchema.Flag.READ_ONLY });
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.core.data.DefaultTaskSchema
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.core.data;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.Assert;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.TaskRepository;

public class TaskHistory
{
  private final TaskRepository repository;
  private final List<TaskRevision> revisions;
  private final ITask task;
  
  public TaskHistory(TaskRepository repository, ITask task)
  {
    Assert.isNotNull(repository);
    Assert.isNotNull(task);
    this.repository = repository;
    this.task = task;
    revisions = new ArrayList();
  }
  
  public void add(TaskRevision entry)
  {
    revisions.add(entry);
  }
  
  public TaskRepository getRepository()
  {
    return repository;
  }
  
  public List<TaskRevision> getRevisions()
  {
    return new ArrayList(revisions);
  }
  
  public TaskRevision getRevision(String id)
  {
    for (TaskRevision revision : revisions) {
      if (revision.getId().equals(id)) {
        return revision;
      }
    }
    return null;
  }
  
  public ITask getTask()
  {
    return task;
  }
  
  public void remove(TaskRevision entry)
  {
    revisions.remove(entry);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.core.data.TaskHistory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.core.data;

public abstract interface ITaskAttributeDiff
{
  public abstract String getAttributeId();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.core.data.ITaskAttributeDiff
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.core.data;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.Assert;

public final class TaskAttribute
{
  public static final String ADD_SELF_CC = "task.common.addselfcc";
  public static final String ATTACHMENT_AUTHOR = "task.common.attachment.author";
  public static final String ATTACHMENT_CONTENT_TYPE = "task.common.attachment.ctype";
  public static final String ATTACHMENT_DATE = "task.common.attachment.date";
  public static final String ATTACHMENT_DESCRIPTION = "task.common.attachment.description";
  public static final String ATTACHMENT_FILENAME = "filename";
  public static final String ATTACHMENT_ID = "task.common.attachment.id";
  public static final String ATTACHMENT_IS_DEPRECATED = "task.common.attachment.deprecated";
  public static final String ATTACHMENT_IS_PATCH = "task.common.attachment.patch";
  public static final String ATTACHMENT_REPLACE_EXISTING = "task.common.attachment.replaceExisting";
  public static final String ATTACHMENT_SIZE = "task.common.attachment.size";
  public static final String ATTACHMENT_URL = "task.common.attachment.url";
  public static final String COMMENT_ATTACHMENT_ID = "task.common.comment.attachment.id";
  public static final String COMMENT_AUTHOR = "task.common.comment.author";
  @Deprecated
  public static final String COMMENT_AUTHOR_NAME = "task.common.comment.author.name";
  public static final String COMMENT_DATE = "task.common.comment.date";
  public static final String COMMENT_HAS_ATTACHMENT = "task.common.comment.attachment";
  public static final String COMMENT_NEW = "task.common.comment.new";
  public static final String COMMENT_NUMBER = "task.common.comment.number";
  public static final String COMMENT_TEXT = "task.common.comment.text";
  public static final String COMMENT_URL = "task.common.comment.url";
  public static final String COMPONENT = "task.common.component";
  public static final String DATE_COMPLETION = "task.common.date.completed";
  public static final String DATE_CREATION = "task.common.date.created";
  public static final String DATE_DUE = "task.common.date.due";
  public static final String DATE_MODIFICATION = "task.common.date.modified";
  public static final String DESCRIPTION = "task.common.description";
  public static final String KEYWORDS = "task.common.keywords";
  public static final String KIND_DEFAULT = "task.common.kind.default";
  public static final String KIND_OPERATION = "task.common.kind.operation";
  public static final String KIND_PEOPLE = "task.common.kind.people";
  public static final String META_ASSOCIATED_ATTRIBUTE_ID = "task.meta.associated.attribute";
  public static final String META_ATTRIBUTE_KIND = "task.meta.attributeKind";
  public static final String META_ATTRIBUTE_TYPE = "task.meta.type";
  public static final String META_DEFAULT_OPTION = "task.meta.defaultOption";
  public static final String META_LABEL = "task.meta.label";
  public static final String META_READ_ONLY = "task.meta.readOnly";
  public static final String COMMENT_ISPRIVATE = "task.common.comment.isprivate";
  public static final String META_DISABLED = "task.meta.disabled";
  public static final String META_DESCRIPTION = "task.meta.description";
  public static final String META_INDEXED_AS_CONTENT = "task.meta.index.content";
  public static final String NEW_ATTACHMENT = "task.common.new.attachment";
  public static final String OPERATION = "task.common.operation";
  public static final String PERSON_NAME = "task.common.person.name";
  public static final String PREFIX_ATTACHMENT = "task.common.attachment-";
  public static final String PREFIX_COMMENT = "task.common.comment-";
  public static final String PREFIX_OPERATION = "task.common.operation-";
  public static final String PRIORITY = "task.common.priority";
  public static final String PRODUCT = "task.common.product";
  public static final String RESOLUTION = "task.common.resolution";
  public static final String STATUS = "task.common.status";
  public static final String SUMMARY = "task.common.summary";
  public static final String TASK_KEY = "task.common.key";
  public static final String TASK_KIND = "task.common.kind";
  public static final String RANK = "task.common.rank";
  public static final String TASK_URL = "task.common.url";
  public static final String TYPE_ATTACHMENT = "attachment";
  public static final String TYPE_BOOLEAN = "boolean";
  public static final String TYPE_COMMENT = "comment";
  public static final String TYPE_CONTAINER = "container";
  public static final String TYPE_DATE = "date";
  public static final String TYPE_DATETIME = "dateTime";
  public static final String TYPE_INTEGER = "integer";
  public static final String TYPE_LONG = "long";
  public static final String TYPE_LONG_RICH_TEXT = "longRichText";
  public static final String TYPE_LONG_TEXT = "longText";
  public static final String TYPE_MULTI_SELECT = "multiSelect";
  public static final String TYPE_OPERATION = "operation";
  public static final String TYPE_PERSON = "person";
  public static final String TYPE_SHORT_RICH_TEXT = "shortRichText";
  public static final String TYPE_SHORT_TEXT = "shortText";
  public static final String TYPE_SINGLE_SELECT = "singleSelect";
  public static final String TYPE_TASK_DEPENDENCY = "taskDepenedency";
  public static final String TYPE_URL = "url";
  public static final String TYPE_DOUBLE = "double";
  public static final String USER_ASSIGNED = "task.common.user.assigned";
  @Deprecated
  public static final String USER_ASSIGNED_NAME = "task.common.user.assigned.name";
  public static final String USER_CC = "task.common.user.cc";
  public static final String USER_REPORTER = "task.common.user.reporter";
  @Deprecated
  public static final String USER_REPORTER_NAME = "task.common.user.reporter.name";
  public static final String SEVERITY = "task.common.severity";
  public static final String VERSION = "task.common.version";
  private Map<String, TaskAttribute> attributeById;
  private final String attributeId;
  private Map<String, String> metaData;
  private Map<String, String> optionByKey;
  private final TaskAttribute parentAttribute;
  private final TaskData taskData;
  private final List<String> values;
  
  public TaskAttribute(TaskAttribute parentAttribute, String attributeId)
  {
    Assert.isNotNull(parentAttribute);
    Assert.isNotNull(attributeId);
    this.parentAttribute = parentAttribute;
    this.attributeId = attributeId.intern();
    taskData = parentAttribute.getTaskData();
    values = new ArrayList(1);
    parentAttribute.add(this);
  }
  
  TaskAttribute(TaskData taskData)
  {
    Assert.isNotNull(taskData);
    parentAttribute = null;
    this.taskData = taskData;
    attributeId = "root";
    values = new ArrayList(1);
  }
  
  private void add(TaskAttribute attribute)
  {
    if (attributeById == null) {
      attributeById = new LinkedHashMap();
    }
    attributeById.put(attribute.getId(), attribute);
  }
  
  public void addValue(String value)
  {
    Assert.isNotNull(value);
    values.add(value);
  }
  
  public void clearAttributes()
  {
    attributeById = null;
  }
  
  void clearMetaDataMap()
  {
    metaData = null;
  }
  
  public void clearOptions()
  {
    optionByKey = null;
  }
  
  public void clearValues()
  {
    values.clear();
  }
  
  public TaskAttribute createAttribute(String attributeId)
  {
    return new TaskAttribute(this, attributeId);
  }
  
  public void deepAddCopy(TaskAttribute source)
  {
    TaskAttribute target = createAttribute(source.getId());
    values.addAll(values);
    if (metaData != null) {
      metaData = new LinkedHashMap(metaData);
    }
    if (optionByKey != null) {
      optionByKey = new LinkedHashMap(optionByKey);
    }
    if (attributeById != null) {
      for (TaskAttribute child : attributeById.values()) {
        target.deepAddCopy(child);
      }
    }
  }
  
  public boolean equals(Object obj)
  {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    TaskAttribute other = (TaskAttribute)obj;
    if (attributeId == null)
    {
      if (attributeId != null) {
        return false;
      }
    }
    else if (!attributeId.equals(attributeId)) {
      return false;
    }
    return true;
  }
  
  public TaskAttribute getAttribute(String attributeId)
  {
    Assert.isNotNull(attributeId);
    return attributeById != null ? (TaskAttribute)attributeById.get(attributeId) : null;
  }
  
  public Map<String, TaskAttribute> getAttributes()
  {
    if (attributeById != null) {
      return Collections.unmodifiableMap(attributeById);
    }
    return Collections.emptyMap();
  }
  
  public String getId()
  {
    return attributeId;
  }
  
  public TaskAttribute getMappedAttribute(String attributeId)
  {
    Assert.isNotNull(attributeId);
    return attributeById != null ? (TaskAttribute)attributeById.get(getTaskData().getAttributeMapper().mapToRepositoryKey(this, 
      attributeId)) : null;
  }
  
  public TaskAttribute getMappedAttribute(String[] path)
  {
    TaskAttribute attribute = this;
    String[] arrayOfString;
    int j = (arrayOfString = path).length;
    for (int i = 0; i < j; i++)
    {
      String id = arrayOfString[i];
      attribute = attribute.getMappedAttribute(id);
      if (attribute == null) {
        break;
      }
    }
    return attribute;
  }
  
  String getMetaDatum(String key)
  {
    return metaData != null ? (String)metaData.get(key) : null;
  }
  
  Map<String, String> getMetaDataMap()
  {
    if (metaData != null) {
      return Collections.unmodifiableMap(metaData);
    }
    return Collections.emptyMap();
  }
  
  public String getOption(String key)
  {
    return optionByKey != null ? (String)optionByKey.get(key) : null;
  }
  
  public Map<String, String> getOptions()
  {
    if (optionByKey != null) {
      return Collections.unmodifiableMap(optionByKey);
    }
    return Collections.emptyMap();
  }
  
  public TaskAttribute getParentAttribute()
  {
    return parentAttribute;
  }
  
  public String[] getPath()
  {
    List<String> path = new ArrayList();
    TaskAttribute attribute = this;
    while (attribute.getParentAttribute() != null)
    {
      path.add(attribute.getId());
      attribute = attribute.getParentAttribute();
    }
    Collections.reverse(path);
    return (String[])path.toArray(new String[0]);
  }
  
  public TaskAttributeMetaData getMetaData()
  {
    return new TaskAttributeMetaData(this);
  }
  
  public TaskData getTaskData()
  {
    return taskData;
  }
  
  public String getValue()
  {
    if (values.size() > 0) {
      return (String)values.get(0);
    }
    return "";
  }
  
  public List<String> getValues()
  {
    return Collections.unmodifiableList(values);
  }
  
  public int hashCode()
  {
    int result = 1;
    result = 31 * result + (attributeId == null ? 0 : attributeId.hashCode());
    return result;
  }
  
  void putMetaDatum(String key, String value)
  {
    Assert.isNotNull(key);
    Assert.isNotNull(value);
    if (metaData == null) {
      metaData = new LinkedHashMap();
    }
    metaData.put(key.intern(), value);
  }
  
  public void putOption(String key, String value)
  {
    Assert.isNotNull(key);
    Assert.isNotNull(value);
    if (optionByKey == null) {
      optionByKey = new LinkedHashMap();
    }
    optionByKey.put(key.intern(), value);
  }
  
  public void removeAttribute(String attributeId)
  {
    if (attributeById != null) {
      attributeById.remove(attributeId);
    }
  }
  
  void removeMetaDatum(String metaDataId)
  {
    if (metaData != null) {
      metaData.remove(metaDataId);
    }
  }
  
  public void removeValue(String value)
  {
    values.remove(value);
  }
  
  public void setValue(String value)
  {
    Assert.isNotNull(value);
    if (values.size() > 0) {
      values.clear();
    }
    values.add(value);
  }
  
  public void setValues(List<String> values)
  {
    this.values.clear();
    this.values.addAll(values);
  }
  
  public String toString()
  {
    StringBuilder sb = new StringBuilder();
    toString(sb, "");
    return sb.toString();
  }
  
  private void toString(StringBuilder sb, String prefix)
  {
    sb.append(prefix);
    sb.append("TaskAttribute[id=");
    sb.append(attributeId);
    sb.append(",values=");
    sb.append(values);
    sb.append(",options=");
    sb.append(optionByKey);
    sb.append(",metaData=");
    sb.append(metaData);
    sb.append("]");
    if (attributeById != null) {
      for (TaskAttribute child : attributeById.values())
      {
        sb.append("\n");
        child.toString(sb, prefix + " ");
      }
    }
  }
  
  public TaskAttribute createMappedAttribute(String attributeId)
  {
    Assert.isNotNull(attributeId);
    String mappedAttributeId = getTaskData().getAttributeMapper().mapToRepositoryKey(this, attributeId);
    Assert.isNotNull(mappedAttributeId);
    return new TaskAttribute(this, mappedAttributeId);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.core.data.TaskAttribute
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.core.data;

import java.util.Arrays;
import java.util.EnumSet;

public class AbstractTaskSchema$FieldFactory
{
  private EnumSet<AbstractTaskSchema.Flag> flags;
  private String key;
  private String label;
  private String type;
  
  public AbstractTaskSchema$FieldFactory(AbstractTaskSchema paramAbstractTaskSchema, AbstractTaskSchema.Field source)
  {
    flags = EnumSet.copyOf(AbstractTaskSchema.Field.access$0(source));
    key = AbstractTaskSchema.Field.access$1(source);
    label = AbstractTaskSchema.Field.access$2(source);
    type = AbstractTaskSchema.Field.access$3(source);
  }
  
  public FieldFactory addFlags(AbstractTaskSchema.Flag... flags)
  {
    this.flags.addAll(Arrays.asList(flags));
    return this;
  }
  
  public AbstractTaskSchema.Field create()
  {
    return this$0.createField(key, label, type, !flags.isEmpty() ? (AbstractTaskSchema.Flag[])flags.toArray(new AbstractTaskSchema.Flag[0]) : null);
  }
  
  public FieldFactory flags(AbstractTaskSchema.Flag... flags)
  {
    this.flags = EnumSet.copyOf(Arrays.asList(flags));
    return this;
  }
  
  public FieldFactory key(String key)
  {
    this.key = key;
    return this;
  }
  
  public FieldFactory label(String label)
  {
    this.label = label;
    return this;
  }
  
  public FieldFactory removeFlags(AbstractTaskSchema.Flag... flags)
  {
    this.flags.removeAll(Arrays.asList(flags));
    return this;
  }
  
  public FieldFactory type(String type)
  {
    this.type = type;
    return this;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.core.data.AbstractTaskSchema.FieldFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.core.data;

import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.httpclient.methods.multipart.PartSource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;

public class TaskAttachmentPartSource
  implements PartSource
{
  private final AbstractTaskAttachmentSource attachment;
  private final String filename;
  
  public TaskAttachmentPartSource(AbstractTaskAttachmentSource attachment, String filename)
  {
    this.attachment = attachment;
    this.filename = filename;
  }
  
  public InputStream createInputStream()
    throws IOException
  {
    try
    {
      return attachment.createInputStream(null);
    }
    catch (CoreException e)
    {
      StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.core", "Error attaching file", e));
      throw new IOException("Failed to create source stream");
    }
  }
  
  public String getFileName()
  {
    return filename;
  }
  
  public long getLength()
  {
    return attachment.getLength();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.core.data.TaskAttachmentPartSource
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.core.data;

public abstract class TaskDataModelListener
{
  public abstract void attributeChanged(TaskDataModelEvent paramTaskDataModelEvent);
  
  public void modelRefreshed() {}
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.tasks.core.data.TaskDataModelListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.tasks.core.data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.Assert;
import org.eclipse.mylyn.tasks.core.IRepositoryPerson;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
import org.eclipse.mylyn.tasks.core.ITaskComment;
import org.eclipse.mylyn.tasks.core.TaskRepository;

public class TaskAttributeMapper
{
  private final TaskRepository taskRepository;
  
  public TaskAttributeMapper(TaskRepository taskRepository)
  {
    Assert.isNotNull(taskRepository);
    this.taskRepository = taskRepository;
  }
  
  public TaskAttribute createTaskAttachment(TaskData taskData)
  {
    TaskAttribute taskAttribute = taskData.getRoot().createAttribute(
      mapToRepositoryKey(taskData.getRoot(), "task.common.new.attachment"));
    
    return taskAttribute;
  }
  
  public boolean equals(TaskAttribute newAttribute, TaskAttribute oldAttribute)
  {
    if ("comment".equals(newAttribute.getMetaData().getType()))
    {
      if (newAttribute.getValues().equals(oldAttribute.getValues())) {
        return true;
      }
      if (oldAttribute != null)
      {
        TaskAttribute commentIdAttribute = oldAttribute.getAttribute("task.common.comment.id");
        if (((commentIdAttribute == null) || (commentIdAttribute.getValue().equals(""))) && 
          (newAttribute.getValue().equals(""))) {
          return true;
        }
        if ((commentIdAttribute != null) && (commentIdAttribute.getValue().equals(newAttribute.getValue()))) {
          return true;
        }
      }
    }
    return newAttribute.getValues().equals(oldAttribute.getValues());
  }
  
  public TaskAttribute getAssoctiatedAttribute(TaskAttribute taskAttribute)
  {
    String id = taskAttribute.getMetaDatum("task.meta.associated.attribute");
    if (id != null)
    {
      TaskAttribute associatedAttribute = taskAttribute.getAttribute(id);
      if (associatedAttribute != null) {
        return associatedAttribute;
      }
      return taskAttribute.getTaskData().getRoot().getAttribute(id);
    }
    return null;
  }
  
  public TaskAttribute getAssoctiatedAttribute(TaskOperation taskOperation)
  {
    TaskAttribute taskAttribute = taskOperation.getTaskAttribute();
    if (taskAttribute != null) {
      return getAssoctiatedAttribute(taskAttribute);
    }
    return null;
  }
  
  public List<TaskAttribute> getAttributesByType(TaskData taskData, String type)
  {
    Assert.isNotNull(taskData);
    Assert.isNotNull(type);
    List<TaskAttribute> result = new ArrayList();
    for (TaskAttribute taskAttribute : taskData.getRoot().getAttributes().values()) {
      if (type.equals(taskAttribute.getMetaData().getType())) {
        result.add(taskAttribute);
      }
    }
    return result;
  }
  
  public boolean getBooleanValue(TaskAttribute attribute)
  {
    String booleanString = attribute.getValue();
    if ((booleanString != null) && (booleanString.length() > 0)) {
      return Boolean.parseBoolean(booleanString);
    }
    return false;
  }
  
  public Date getDateValue(TaskAttribute attribute)
  {
    String dateString = attribute.getValue();
    try
    {
      if ((dateString != null) && (dateString.length() > 0)) {
        return new Date(Long.parseLong(dateString));
      }
    }
    catch (NumberFormatException localNumberFormatException) {}
    return null;
  }
  
  @Deprecated
  public String getDefaultOption(TaskAttribute taskAttribute)
  {
    return taskAttribute.getMetaData().getDefaultOption();
  }
  
  public Double getDoubleValue(TaskAttribute attribute)
  {
    String doubleString = attribute.getValue();
    try
    {
      if (doubleString != null) {
        return Double.valueOf(Double.parseDouble(doubleString));
      }
    }
    catch (NumberFormatException localNumberFormatException) {}
    return null;
  }
  
  public Integer getIntegerValue(TaskAttribute attribute)
  {
    String integerString = attribute.getValue();
    try
    {
      if (integerString != null) {
        return Integer.valueOf(Integer.parseInt(integerString));
      }
    }
    catch (NumberFormatException localNumberFormatException) {}
    return null;
  }
  
  public String getLabel(TaskAttribute taskAttribute)
  {
    return taskAttribute.getMetaData().getLabel();
  }
  
  public Long getLongValue(TaskAttribute attribute)
  {
    String longString = attribute.getValue();
    try
    {
      if (longString != null) {
        return Long.valueOf(Long.parseLong(longString));
      }
    }
    catch (NumberFormatException localNumberFormatException) {}
    return null;
  }
  
  public Map<String, String> getOptions(TaskAttribute attribute)
  {
    return attribute.getOptions();
  }
  
  public IRepositoryPerson getRepositoryPerson(TaskAttribute taskAttribute)
  {
    IRepositoryPerson person = taskRepository.createPerson(taskAttribute.getValue());
    TaskAttribute child = taskAttribute.getMappedAttribute("task.common.person.name");
    if (child != null) {
      person.setName(getValue(child));
    }
    return person;
  }
  
  public List<TaskOperation> getTaskOperations(TaskAttribute operationsAttribute)
  {
    Assert.isNotNull(operationsAttribute);
    TaskData taskData = operationsAttribute.getTaskData();
    List<TaskOperati
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd