Package org.eclipse.mylyn.tasks.ui.editors

Examples of org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor


    composite.setLayoutData(gd);

    AttributePartLayoutHelper layoutHelper = new AttributePartLayoutHelper(composite, toolkit, true);

   
    AbstractAttributeEditor editor = createAttributeEditor(getTaskData().getRoot().getMappedAttribute(TaskAttribute.USER_ASSIGNED));
    if (editor!=null) {
      editor.createLabelControl(composite, toolkit);
      editor.createControl(composite, toolkit);
      layoutHelper.setLayoutData(editor);
      getTaskEditorPage().getAttributeEditorToolkit().adapt(editor);
    }
   
    editor = createAttributeEditor(getTaskData().getRoot().getMappedAttribute(TaskAttribute.USER_REPORTER));
    if (editor!=null) {
      editor.createLabelControl(composite, toolkit);
      editor.createControl(composite, toolkit);
      layoutHelper.setLayoutData(editor);
      getTaskEditorPage().getAttributeEditorToolkit().adapt(editor);
    }
   
    TaskAttribute attribute = getTaskData().getRoot().getMappedAttribute(RedmineAttribute.WATCHERS.getTaskKey());
    if (attribute!=null && (editor = createAttributeEditor(attribute))!=null && editor instanceof RedmineWatchersEditor ) {
     
      attribute = attribute.getAttribute(RedmineAttribute.WATCHERS_ADD.getTaskKey());
      if (attribute != null) {
       
        RedminePersonEditor personEditor = new RedminePersonEditor(getModel(), attribute) {
          @Override
          public void setValue(String value) {
            value = RedmineUtil.findUserLogin(value);
            if(value!=null && !value.isEmpty()) {
              IRepositoryPerson person = getModel().getTaskRepository().createPerson(value);
              watchersEditor.addWatcher(person);
              text.setText("");
            }
          };
         
          @Override
          public String getValue() {
            return "";
          };
         
        };
       
        personEditor.createLabelControl(composite, toolkit);
        personEditor.createControl(composite, toolkit);
        personEditor.setDecorationEnabled(false);
        layoutHelper.setLayoutData(personEditor);
        getTaskEditorPage().getAttributeEditorToolkit().adapt(personEditor);
      }


      editor.createLabelControl(composite, toolkit);
      editor.createControl(composite, toolkit);
      layoutHelper.setLayoutData(editor);
      getTaskEditorPage().getAttributeEditorToolkit().adapt(editor);
      watchersEditor = (RedmineWatchersEditor)editor;
    }
   
View Full Code Here


//      toolBarManager.add(replyAction);
//      toolBarManager.createControl(buttonComposite);

      //Hours
      AttributeEditorToolkit editorToolkit = getTaskEditorPage().getAttributeEditorToolkit();
      AbstractAttributeEditor attributeEditor = createAttributeEditor(RedmineTaskTimeEntryMapper.getHoursAttribute(attribute));
      attributeEditor.createLabelControl(titleComposite, toolkit);
      attributeEditor.createControl(titleComposite, toolkit);
      attributeEditor.getLabelControl().setBackground(bgColor);
      editorToolkit.adapt(attributeEditor);
     
      //Activity
      attributeEditor = createAttributeEditor(RedmineTaskTimeEntryMapper.getActivityAttribute(attribute));
      attributeEditor.createLabelControl(titleComposite, toolkit);
      attributeEditor.createControl(titleComposite, toolkit);
      attributeEditor.getLabelControl().setBackground(bgColor);
      editorToolkit.adapt(attributeEditor);
     
      return expandCommentHyperlink;
    }
View Full Code Here

        List<TaskAttribute> attributes = new ArrayList<TaskAttribute>();
        attributes.add(RedmineTaskTimeEntryMapper.getCommentsAttribute(attribute));
        attributes.addAll(RedmineTaskTimeEntryMapper.getCustomAttributes(attribute));
       
        for (TaskAttribute taskAttribute : attributes) {
          AbstractAttributeEditor editor = createAttributeEditor(taskAttribute);
          if (editor != null) {
            editor.createLabelControl(composite, toolkit);
            editor.createControl(composite, toolkit);
           
           
//            editor.getControl().addMouseListener(new MouseAdapter() {
//              @Override
//              public void mouseDown(MouseEvent e) {
View Full Code Here

    gd.horizontalSpan = 4;
    composite.setLayoutData(gd);

    AttributeEditorToolkit editorToolkit = getTaskEditorPage().getAttributeEditorToolkit();
    TaskAttribute root = getTaskData().getRoot();
    AbstractAttributeEditor attributeEditor;
    TaskAttribute attribute;
    AttributePartLayoutHelper layoutHelper = new AttributePartLayoutHelper(composite, toolkit, true);

    attribute = root.getAttribute(RedmineAttribute.TIME_ENTRY_HOURS.getTaskKey());
    if (attribute != null) {
      //TODO WORKAROUND - remove later
      if (!attribute.getMetaData().getType().equals(IRedmineConstants.EDITOR_TYPE_DURATION)) {
        attribute.getMetaData().setType(IRedmineConstants.EDITOR_TYPE_DURATION);
      }
      attributeList.add(attribute.getId());
      attributeEditor = createAttributeEditor(attribute);
      attributeEditor.createLabelControl(composite, toolkit);
      attributeEditor.createControl(composite, toolkit);
      attributeEditor.setDecorationEnabled(false);
      layoutHelper.setLayoutData(attributeEditor);
      editorToolkit.adapt(attributeEditor);
     
      attributeEditor.getControl();
    }
   

    attribute = root.getAttribute(RedmineAttribute.TIME_ENTRY_ACTIVITY.getTaskKey());
    if (attribute != null) {
      attributeList.add(attribute.getId());
      attributeEditor = createAttributeEditor(attribute);
      attributeEditor.createLabelControl(composite, toolkit);
      attributeEditor.createControl(composite, toolkit);
      attributeEditor.setDecorationEnabled(false);
      layoutHelper.setLayoutData(attributeEditor);
      editorToolkit.adapt(attributeEditor);
    }
   
    attribute = root.getAttribute(RedmineAttribute.TIME_ENTRY_COMMENTS.getTaskKey());
    if (attribute != null) {
      attributeList.add(attribute.getId());
      attributeEditor = createAttributeEditor(attribute);
      attributeEditor.createLabelControl(composite, toolkit);
      attributeEditor.createControl(composite, toolkit);
      attributeEditor.setDecorationEnabled(false);
      layoutHelper.setLayoutData(attributeEditor);
      editorToolkit.adapt(attributeEditor);
    }

    for (TaskAttribute childAttribute : root.getAttributes().values()) {
      if(childAttribute.getId().startsWith(IRedmineConstants.TASK_KEY_PREFIX_TIMEENTRY_EX)) {
        attributeList.add(childAttribute.getId());
        attributeEditor = createAttributeEditor(childAttribute);
        attributeEditor.createLabelControl(composite, toolkit);
        attributeEditor.createControl(composite, toolkit);
        attributeEditor.setDecorationEnabled(false);
        layoutHelper.setLayoutData(attributeEditor);
        editorToolkit.adapt(attributeEditor);
      }
    }
   
    for (TaskAttribute childAttribute : root.getAttributes().values()) {
      if(childAttribute.getId().startsWith(IRedmineConstants.TASK_KEY_PREFIX_TIMEENTRY_CF)) {
        attributeList.add(childAttribute.getId());
        attributeEditor = createAttributeEditor(childAttribute);
        attributeEditor.createLabelControl(composite, toolkit);
        attributeEditor.createControl(composite, toolkit);
        attributeEditor.setDecorationEnabled(false);
        layoutHelper.setLayoutData(attributeEditor);
        editorToolkit.adapt(attributeEditor);
      }
    }
   
View Full Code Here

          if(!RedmineTaskEditorPage.this.customFields.containsKey(taskAttribute.getId())) {
            return null;
          }
        }

        final AbstractAttributeEditor editor;
        if(IRedmineConstants.EDITOR_TYPE_ESTIMATED.equals(type)) {
          editor = new EstimatedEditor(getModel(), taskAttribute);
        } else if(IRedmineConstants.EDITOR_TYPE_DURATION.equals(type)) {
          editor = new DurationEditor(getModel(), taskAttribute);
        } else if(IRedmineConstants.EDITOR_TYPE_PARENTTASK.equals(type)) {
          editor = super.createEditor(TaskAttribute.TYPE_TASK_DEPENDENCY, taskAttribute);
          editor.setLayoutHint(new LayoutHint(RowSpan.SINGLE, ColumnSpan.SINGLE));
        } else if(IRedmineConstants.EDITOR_TYPE_WATCHERS.equals(type)) {
          editor = new RedmineWatchersEditor(cfg, getModel(), taskAttribute);
        } else if(IRedmineConstants.EDITOR_TYPE_PERSON.equals(type)) {
          editor = new RedminePersonEditor(getModel(), taskAttribute);
        } else {
View Full Code Here

      attributeEditors.get(taskAttribute).refresh();
    }
  }
 
  protected void removeEditor(TaskAttribute taskAttribute) {
    AbstractAttributeEditor editor = attributeEditors.remove(taskAttribute);
    if(editor!=null) {
      editor.getLabelControl().dispose();
      editor.getControl().dispose();
    }
  }
View Full Code Here

    AttributePartLayoutHelper layoutHelper = new AttributePartLayoutHelper(parent, getManagedForm().getToolkit());
   
    for (CustomField cf : customFields.values()) {
      TaskAttribute cfAttribute = rootAttribute.getAttribute(IRedmineConstants.TASK_KEY_PREFIX_ISSUE_CF + cf.getId());
      if (cfAttribute!=null) {
        AbstractAttributeEditor cfEditor = getAttributeEditorFactory().createEditor(cfAttribute.getMetaData().getType(), cfAttribute);

        cfEditor.createLabelControl(parent, getManagedForm().getToolkit());
        cfEditor.createControl(parent, getManagedForm().getToolkit());
        layoutHelper.setLayoutData(cfEditor);
       
        getAttributeEditorToolkit().adapt(cfEditor);
        attributeEditors.put(cfAttribute, cfEditor);
      }
View Full Code Here

        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) {
              Listener[] listeners = control.getListeners(SWT.Selection);
              if(listeners!=null && listeners.length==2) {
                Event e = new Event();
                e.widget = control;
View Full Code Here

    gd.horizontalSpan = 4;
    timeComposite.setLayoutData(gd);

    AttributeEditorToolkit editorToolkit = getTaskEditorPage().getAttributeEditorToolkit();
    TaskAttribute rootAttribute = getTaskData().getRoot();
    AbstractAttributeEditor attributeEditor;
    TaskAttribute attribute;

    attribute = rootAttribute.getAttribute(RedmineAttribute.DATE_START.getTaskKey());
    if (attribute != null) {
      attributeEditor = createAttributeEditor(attribute);
      attributeEditor.createLabelControl(timeComposite, toolkit);
      attributeEditor.createControl(timeComposite, toolkit);
      editorToolkit.adapt(attributeEditor);
    }

    attribute = rootAttribute.getAttribute(RedmineAttribute.DATE_DUE.getTaskKey());
    if (attribute != null) {
      attributeEditor = createAttributeEditor(attribute);
      attributeEditor.createLabelControl(timeComposite, toolkit);
      attributeEditor.createControl(timeComposite, toolkit);
      editorToolkit.adapt(attributeEditor);
    }

    attribute = rootAttribute.getAttribute(RedmineAttribute.ESTIMATED.getTaskKey());
    if (attribute != null) {
      attributeEditor = createAttributeEditor(attribute);
      attributeEditor.createLabelControl(timeComposite, toolkit);
      attributeEditor.createControl(timeComposite, toolkit);
      editorToolkit.adapt(attributeEditor);
    }

    toolkit.paintBordersFor(timeComposite);
    timeSection.setClient(timeComposite);
View Full Code Here

    @Override
    protected AttributeEditorFactory createAttributeEditorFactory() {
        AttributeEditorFactory factory = new AttributeEditorFactory(getModel(), getTaskRepository(), getEditorSite()) {
            @Override
            public AbstractAttributeEditor createEditor(String type, final TaskAttribute taskAttribute) {
                AbstractAttributeEditor editor;
                if (IGoogleCodeConstants.EDITOR_TYPE_STARS.equals(type)) {
                    editor = new StarsAttributeEditor(getModel(), taskAttribute);
                } else {
                    editor = super.createEditor(type, taskAttribute);
                }
View Full Code Here

TOP

Related Classes of org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor

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.