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

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


      if(taskDataManager.hasTaskData(task)) {
        String attributeName = null;
        try {
         
          boolean openTask = true;
          TaskDataModel model = RedmineTasksUiUtil.findOpenTaskModel(task);
         
          if(model==null) {
            openTask = false;
            ITaskDataWorkingCopy copy = taskDataManager.getWorkingCopy(task);
            model = new TaskDataModel(repository, task, copy);
          }

          TaskData taskData = model.getTaskData();
         
         
          for (RedmineAttribute redmineAttribute : attributes) {
            if(redmineAttribute!=null) {
              attributeName = redmineAttribute.name();
              TaskAttribute attribute = taskData.getRoot().getAttribute(redmineAttribute.getTaskKey());

              String newValue = getValue(redmineAttribute, taskData);
              if(!attribute.getValue().equals(newValue)) {
                if(openTask) {
                  setOpenTaskValue(attribute, newValue, taskData, model);
                } else {
                  setClosedTaskValue(attribute, newValue, taskData, model);
                }
              }
             
            }
          }

          if(!openTask) {
            model.save(new NullProgressMonitor());
          }

                   
        } catch (CoreException e) {
          ILogService log = RedmineUiPlugin.getLogService(getClass());
View Full Code Here


    @Override
    public void attributeChanged(TaskDataModelEvent event) {
      TaskAttribute changedAttribute = event.getTaskAttribute();
     
      if(changedAttribute.getId().equals(RedmineAttribute.STATUS_CHG.getTaskKey())) {
        TaskDataModel model = event.getModel();
       
        TaskAttribute markasOperation = model.getTaskData().getRoot().getAttribute(TaskAttribute.PREFIX_OPERATION + RedmineOperation.markas.toString());
        if(markasOperation!=null) {
          TaskAttribute operation = model.getTaskData().getRoot().getAttribute(TaskAttribute.OPERATION);
          model.getTaskData().getAttributeMapper().setValue(operation, RedmineOperation.markas.toString());
          model.attributeChanged(operation);
         
          AbstractAttributeEditor statusChgEditor = attributeEditors.get(changedAttribute);
          if(statusChgEditor!=null) {
            Control control = statusChgEditor.getControl();
            if(control!=null && control instanceof CCombo) {
View Full Code Here

         
          TaskEditor taskEditorPart = (TaskEditor)editorPart;
          IFormPage page = taskEditorPart.findPage(RedmineTaskEditorPage.ID);
          if(page!=null) {

            TaskDataModel model = ((RedmineTaskEditorPage)page).getModel();
            ITask editorTask = model.getTask();
            if (editorTask!=null && (editorTask==task || editorTask.getHandleIdentifier().equals(task.getHandleIdentifier()))) {
              return model;
            }
          }
        }
View Full Code Here

TOP

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

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.