Package net.sf.redmine_mylyn.internal.ui.action

Source Code of net.sf.redmine_mylyn.internal.ui.action.RedmineStatusAttributeChangeAction

package net.sf.redmine_mylyn.internal.ui.action;

import net.sf.redmine_mylyn.core.RedmineAttribute;
import net.sf.redmine_mylyn.core.RedmineOperation;

import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;

public class RedmineStatusAttributeChangeAction extends AbstractRedmineAttributeChangeAction {
 
  private final  String value;
 
  public RedmineStatusAttributeChangeAction(String statusId, String statusName, ITask[] tasks) {
    super(RedmineAttribute.STATUS_CHG, tasks);
    setText(statusName);
    this.value = statusId;
  }
 
  @Override
  protected String getValue(RedmineAttribute attribute, TaskData taskData) {
    return value;
  }
 
  @Override
  protected void setClosedTaskValue(TaskAttribute attribute, String value, TaskData taskData, TaskDataModel model) {
    super.setClosedTaskValue(attribute, value, taskData, model);

    TaskAttribute markasOperation = taskData.getRoot().getAttribute(TaskAttribute.PREFIX_OPERATION + RedmineOperation.markas.toString());
    if(markasOperation!=null) {
      TaskAttribute operation = taskData.getRoot().getAttribute(TaskAttribute.OPERATION);
      taskData.getAttributeMapper().setValue(operation, RedmineOperation.markas.toString());
      model.attributeChanged(operation);
    }
  }
 
}
TOP

Related Classes of net.sf.redmine_mylyn.internal.ui.action.RedmineStatusAttributeChangeAction

TOP
Copyright © 2018 www.massapi.com. 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.