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

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


//      replyAction.setImageDescriptor(TasksUiImages.COMMENT_REPLY_SMALL);
//      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


    }

    private void expandTimeEntry(FormToolkit toolkit, Composite composite, boolean expanded) {
//      buttonComposite.setVisible(expanded);
      if (expanded) {
        AttributeEditorToolkit editorToolkit = getTaskEditorPage().getAttributeEditorToolkit();

        AttributePartLayoutHelper layoutHelper = new AttributePartLayoutHelper(composite, toolkit, true);
       
        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) {
//                getTaskEditorPage().selectionChanged(taskComment);
//              }
//            });

            layoutHelper.setLayoutData(editor);
            editorToolkit.adapt(editor);
           
           
          }
         
        }
View Full Code Here

    composite.setLayout(new GridLayout(4, false));
    GridData gd = new GridData();
    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);
      }
    }
   
    toolkit.paintBordersFor(composite);
    section.setClient(composite);
View Full Code Here

    timeComposite.setLayout(new GridLayout(6, false));
    GridData gd = new GridData();
    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);
    setSection(toolkit, timeSection);
View Full Code Here

TOP

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

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.