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

e.setLayout(layout);
    
    TaskAttribute priorityAttribute = getTaskData().getRoot().getMappedAttribute("task.common.priority");
    final Control priorityEditor = addAttributeWithIcon(composite, toolkit, priorityAttribute, false);
    if (priorityEditor != null)
    {
      GridDataFactory.fillDefaults().align(16777216, 16777216).span(1, 2).applyTo(priorityEditor);
      
      priorityEditor.addFocusListener(new FocusAdapter()
      {
        public void focusGained(FocusEvent e)
        {
          if ((summaryEditor != null) && (summaryEditor.getControl() != null))
          {
            summaryEditor.getControl().setFocus();
            
            priorityEditor.removeFocusListener(this);
          }
        }
      });
      numColumns += 1;
    }
    addSummaryText(composite, toolkit);
    if (Boolean.parseBoolean(getModel().getTaskRepository().getProperty(
      "avatarSupport")))
    {
      TaskAttribute userAssignedAttribute = getTaskData().getRoot().getMappedAttribute(
        "task.common.user.assigned");
      if (userAssignedAttribute != null)
      {
        UserAttributeEditor editor = new UserAttributeEditor(getModel(), userAssignedAttribute);
        editor.createControl(composite, toolkit);
        GridDataFactory.fillDefaults()
          .align(16777216, 16777216)
          .span(1, 2)
          .indent(0, 2)
          .applyTo(editor.getControl());
        marginRight = 1;
        numColumns += 1;
      }
    }
    if (needsHeader()) {
      createHeaderLayout(composite, toolkit);
    }
    toolkit.paintBordersFor(composite);
    
    setControl(composite);
  }
  
  protected Composite createHeaderLayout(Composite composite, FormToolkit toolkit)
  {
    Composite headerComposite = toolkit.createComposite(composite);
    GridLayout layout = new GridLayout(1, false);
    verticalSpacing = 1;
    marginHeight = 0;
    marginWidth = 0;
    headerComposite.setLayout(layout);
    GridDataFactory.fillDefaults().grab(true, false).applyTo(headerComposite);
    
    TaskAttribute statusAtribute = getTaskData().getRoot().getMappedAttribute("task.common.status");
    addAttribute(headerComposite, toolkit, statusAtribute, 0, true, true);
    
    ITaskMapping mapping = getTaskEditorPage().getConnector().getTaskMapping(getTaskData());
    if ((mapping != null) && (mapping.getResolution() != null) && (mapping.getResolution().length() > 0))
    {
      TaskAttribute resolutionAtribute = getTaskData().getRoot().getMappedAttribute("task.common.resolution");
      addAttribute(headerComposite, toolkit, resolutionAtribute, 0, false);
    }
    TaskAttribute dateCreation = getTaskData().getRoot().getMappedAttribute("task.common.date.created");
    addAttribute(headerComposite, toolkit, dateCreation);
    
    TaskAttribute dateModified = getTaskData().getRoot().getMappedAttribute("task.common.date.modified");
    addAttribute(headerComposite, toolkit, dateModified);
    
    numColumns = headerComposite.getChildren().length;
    if (numColumns == 0)
    {
      numColumns = 1;
      toolkit.createLabel(headerComposite, " ");
    }
    return headerComposite;
  }
  
  public boolean needsHeader()
  {
    return !getTaskData().isNew();
  }
  
  public void setFocus()
  {
    if ((summaryEditor != null) && (summaryEditor.getControl() != null)) {
      summaryEditor.getControl().setFocus();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorSummaryPart
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.ui.editors;

import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorToolkit;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;

public class TaskEditorRichTextPart
  extends AbstractTaskEditorPart
{
  private RichTextAttributeEditor editor;
  private TaskAttribute attribute;
  private Composite composite;
  private int sectionStyle;
  private Action toggleEditAction;
  private Action toggleBrowserAction;
  private boolean ignoreToggleEvents;
  
  public TaskEditorRichTextPart()
  {
    setSectionStyle(322);
  }
  
  public void appendText(String text)
  {
    if (editor == null) {
      return;
    }
    editor.showEditor();
    if (toggleEditAction != null) {
      toggleEditAction.setChecked(false);
    }
    StringBuilder strBuilder = new StringBuilder();
    String oldText = editor.getViewer().getDocument().get();
    if (strBuilder.length() != 0) {
      strBuilder.append("\n");
    }
    strBuilder.append(oldText);
    strBuilder.append(text);
    editor.getViewer().getDocument().set(strBuilder.toString());
    TaskAttribute attribute = getTaskData().getRoot().getMappedAttribute("task.common.comment.new");
    if (attribute != null)
    {
      attribute.setValue(strBuilder.toString());
      getTaskEditorPage().getModel().attributeChanged(attribute);
    }
    editor.getViewer().getTextWidget().setCaretOffset(strBuilder.length());
    editor.getViewer().getTextWidget().showSelection();
  }
  
  public int getSectionStyle()
  {
    return sectionStyle;
  }
  
  public void setSectionStyle(int sectionStyle)
  {
    this.sectionStyle = sectionStyle;
  }
  
  public void createControl(Composite parent, FormToolkit toolkit)
  {
    if (attribute == null) {
      return;
    }
    AbstractAttributeEditor attributEditor = createAttributeEditor(attribute);
    if (!(attributEditor instanceof RichTextAttributeEditor))
    {
      String clazz;
      String clazz;
      if (attributEditor != null) {
        clazz = attributEditor.getClass().getName();
      } else {
        clazz = "<null>";
      }
      StatusHandler.log(new Status(2, "org.eclipse.mylyn.tasks.ui", 
        "Expected an instance of RichTextAttributeEditor, got \"" + clazz + "\""));
      return;
    }
    Section section = createSection(parent, toolkit, sectionStyle);
    
    composite = toolkit.createComposite(section);
    composite.setLayout(EditorUtil.createSectionClientLayout());
    
    editor = ((RichTextAttributeEditor)attributEditor);
    
    editor.createControl(composite, toolkit);
    if (editor.isReadOnly())
    {
      composite.setLayout(new FillWidthLayout(EditorUtil.getLayoutAdvisor(getTaskEditorPage()), 0, 0, 0, 3));
    }
    else
    {
      StyledText textWidget = editor.getViewer().getTextWidget();
      editor.getControl().setLayoutData(
        EditorUtil.getTextControlLayoutData(getTaskEditorPage(), textWidget, getExpandVertically()));
      editor.getControl().setData("FormWidgetFactory.drawBorder", "treeBorder");
    }
    getEditor().getControl().setData("maximizeAction", getMaximizePartAction());
    if ((getEditor().getControl() instanceof Composite))
    {
      Control[] arrayOfControl;
      int j = (arrayOfControl = ((Composite)getEditor().getControl()).getChildren()).length;
      for (int i = 0; i < j; i++)
      {
        Control control = arrayOfControl[i];
        control.setData("maximizeAction", getMaximizePartAction());
      }
    }
    getTaskEditorPage().getAttributeEditorToolkit().adapt(editor);
    
    toolkit.paintBordersFor(composite);
    section.setClient(composite);
    setSection(toolkit, section);
  }
  
  public TaskAttribute getAttribute()
  {
    return attribute;
  }
  
  protected Composite getComposite()
  {
    return composite;
  }
  
  protected RichTextAttributeEditor getEditor()
  {
    return editor;
  }
  
  public void setAttribute(TaskAttribute attribute)
  {
    this.attribute = attribute;
  }
  
  public void setFocus()
  {
    if (editor != null) {
      editor.getControl().setFocus();
    }
  }
  
  protected void fillToolBar(ToolBarManager manager)
  {
    if (getEditor().hasPreview())
    {
      toggleEditAction = new Action("", 2)
      {
        public void run()
        {
          if (isChecked()) {
            editor.showEditor();
          } else {
            editor.showPreview();
          }
          if (toggleBrowserAction != null) {
            toggleBrowserAction.setChecked(false);
          }
        }
      };
      toggleEditAction.setImageDescriptor(CommonImages.EDIT_SMALL);
      toggleEditAction.setToolTipText(Messages.TaskEditorRichTextPart_Edit_Tooltip);
      toggleEditAction.setChecked(true);
      getEditor().getEditor().addStateChangedListener(new RichTextEditor.StateChangedListener()
      {
        /* Error */
        public void stateChanged(RichTextEditor.StateChangedEvent event)
        {
          // Byte code:
          //   0: aload_0
          //   1: getfield 52	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart$2:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;
          //   4: iconst_1
          //   5: invokestatic 55	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart:access$2	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;Z)V
          //   8: aload_0
          //   9: getfield 52	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart$2:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;
          //   12: invokestatic 56	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart:access$3	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;)Lorg/eclipse/jface/action/Action;
          //   15: aload_1
          //   16: getfield 51	org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$StateChangedEvent:state	Lorg/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$State;
          //   19: getstatic 50	org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$State:EDITOR	Lorg/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$State;
          //   22: if_acmpeq +17 -> 39
          //   25: aload_1
          //   26: getfield 51	org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$StateChangedEvent:state	Lorg/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$State;
          //   29: getstatic 49	org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$State:DEFAULT	Lorg/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$State;
          //   32: if_acmpeq +7 -> 39
          //   35: iconst_0
          //   36: goto +4 -> 40
          //   39: iconst_1
          //   40: invokevirtual 54	org/eclipse/jface/action/Action:setChecked	(Z)V
          //   43: goto +14 -> 57
          //   46: astore_2
          //   47: aload_0
          //   48: getfield 52	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart$2:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;
          //   51: iconst_0
          //   52: invokestatic 55	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart:access$2	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;Z)V
          //   55: aload_2
          //   56: athrow
          //   57: aload_0
          //   58: getfield 52	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart$2:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;
          //   61: iconst_0
          //   62: invokestatic 55	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart:access$2	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;Z)V
          //   65: return
          // Line number table:
          //   Java source line #187	-> byte code offset #0
          //   Java source line #188	-> byte code offset #8
          //   Java source line #189	-> byte code offset #46
          //   Java source line #190	-> byte code offset #47
          //   Java source line #191	-> byte code offset #55
          //   Java source line #190	-> byte code offset #57
          //   Java source line #192	-> byte code offset #65
          // Local variable table:
          //   start	length	slot	name	signature
          //   0	66	0	this	2
          //   0	66	1	event	RichTextEditor.StateChangedEvent
          //   46	10	2	localObject	Object
          // Exception table:
          //   from	to	target	type
          //   0	46	46	finally
        }
      });
      manager.add(toggleEditAction);
    }
    if ((toggleEditAction == null) && (getEditor().hasBrowser()))
    {
      toggleBrowserAction = new Action("", 2)
      {
        public void run()
        {
          if (ignoreToggleEvents) {
            return;
          }
          if (isChecked()) {
            editor.showBrowser();
          } else {
            editor.showEditor();
          }
          if (toggleEditAction != null) {
            toggleEditAction.setChecked(false);
          }
        }
      };
      toggleBrowserAction.setImageDescriptor(CommonImages.PREVIEW_WEB);
      toggleBrowserAction.setToolTipText(Messages.TaskEditorRichTextPart_Browser_Preview);
      toggleBrowserAction.setChecked(false);
      getEditor().getEditor().addStateChangedListener(new RichTextEditor.StateChangedListener()
      {
        /* Error */
        public void stateChanged(RichTextEditor.StateChangedEvent event)
        {
          // Byte code:
          //   0: aload_0
          //   1: getfield 49	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart$4:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;
          //   4: iconst_1
          //   5: invokestatic 52	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart:access$2	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;Z)V
          //   8: aload_0
          //   9: getfield 49	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart$4:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;
          //   12: invokestatic 53	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart:access$1	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;)Lorg/eclipse/jface/action/Action;
          //   15: aload_1
          //   16: getfield 48	org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$StateChangedEvent:state	Lorg/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$State;
          //   19: getstatic 47	org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$State:BROWSER	Lorg/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$State;
          //   22: if_acmpne +7 -> 29
          //   25: iconst_1
          //   26: goto +4 -> 30
          //   29: iconst_0
          //   30: invokevirtual 51	org/eclipse/jface/action/Action:setChecked	(Z)V
          //   33: goto +14 -> 47
          //   36: astore_2
          //   37: aload_0
          //   38: getfield 49	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart$4:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;
          //   41: iconst_0
          //   42: invokestatic 52	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart:access$2	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;Z)V
          //   45: aload_2
          //   46: athrow
          //   47: aload_0
          //   48: getfield 49	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart$4:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;
          //   51: iconst_0
          //   52: invokestatic 52	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart:access$2	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;Z)V
          //   55: return
          // Line number table:
          //   Java source line #220	-> byte code offset #0
          //   Java source line #221	-> byte code offset #8
          //   Java source line #222	-> byte code offset #36
          //   Java source line #223	-> byte code offset #37
          //   Java source line #224	-> byte code offset #45
          //   Java source line #223	-> byte code offset #47
          //   Java source line #225	-> byte code offset #55
          // Local variable table:
          //   start	length	slot	name	signature
          //   0	56	0	this	4
          //   0	56	1	event	RichTextEditor.StateChangedEvent
          //   36	10	2	localObject	Object
          // Exception table:
          //   from	to	target	type
          //   0	36	36	finally
        }
      });
      manager.add(toggleBrowserAction);
    }
    if (!getEditor().isReadOnly()) {
      manager.add(getMaximizePartAction());
    }
    super.fillToolBar(manager);
  }
  
  protected Control getLayoutControl()
  {
    return getEditor() != null ? getEditor().getControl() : null;
  }
  
  public boolean setFormInput(Object input)
  {
    if (((input instanceof String)) && (getAttribute() != null) && 
      (input.equals(getAttribute().getId())))
    {
      EditorUtil.focusOn(getTaskEditorPage().getManagedForm().getForm(), getControl());
      return true;
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorRichTextPart
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.ui.editors;

import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.mylyn.commons.workbench.forms.CommonFormUtil;
import org.eclipse.mylyn.internal.tasks.core.TaskComment;
import org.eclipse.mylyn.tasks.core.IRepositoryPerson;
import org.eclipse.mylyn.tasks.core.ITaskComment;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorToolkit;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.forms.FormColors;
import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ImageHyperlink;

public class TaskEditorCommentPart$CommentViewer
{
  private Composite buttonComposite;
  private final TaskAttribute commentAttribute;
  private ExpandableComposite commentComposite;
  private final TaskComment taskComment;
  private AbstractAttributeEditor editor;
  
  public TaskEditorCommentPart$CommentViewer(TaskEditorCommentPart paramTaskEditorCommentPart, TaskAttribute commentAttribute)
  {
    this.commentAttribute = commentAttribute;
    taskComment = new TaskComment(paramTaskEditorCommentPart.getModel().getTaskRepository(), paramTaskEditorCommentPart.getModel().getTask(), commentAttribute);
  }
  
  public Control createControl(Composite composite, final FormToolkit toolkit)
  {
    boolean hasIncomingChanges = this$0.getModel().hasIncomingChanges(commentAttribute);
    this$0.getTaskData().getAttributeMapper().updateTaskComment(taskComment, commentAttribute);
    int style = 8228;
    if ((hasIncomingChanges) || ((TaskEditorCommentPart.access$1(this$0)) && (!TaskEditorCommentPart.access$2(this$0)))) {
      style |= 0x40;
    }
    commentComposite = toolkit.createExpandableComposite(composite, style);
    commentComposite.clientVerticalSpacing = 0;
    commentComposite.setLayout(new GridLayout());
    commentComposite.setLayoutData(new GridData(768));
    commentComposite.setTitleBarForeground(toolkit.getColors().getColor("org.eclipse.ui.forms.TITLE"));
    
    buttonComposite = createTitle(commentComposite, toolkit);
    
    final Composite commentTextComposite = toolkit.createComposite(commentComposite);
    commentComposite.setClient(commentTextComposite);
    commentTextComposite.setLayout(new FillWidthLayout(EditorUtil.getLayoutAdvisor(this$0.getTaskEditorPage()), 15, 0, 
      0, 3));
    commentComposite.addExpansionListener(new ExpansionAdapter()
    {
      public void expansionStateChanged(ExpansionEvent event)
      {
        TaskEditorCommentPart.CommentViewer.this.expandComment(toolkit, commentTextComposite, event.getState());
      }
    });
    if (hasIncomingChanges) {
      commentComposite.setBackground(this$0.getTaskEditorPage().getAttributeEditorToolkit().getColorIncoming());
    }
    if (commentComposite.isExpanded()) {
      expandComment(toolkit, commentTextComposite, true);
    }
    EditorUtil.setMarker(commentComposite, commentAttribute.getId());
    return commentComposite;
  }
  
  private Composite createTitle(final ExpandableComposite commentComposite, FormToolkit toolkit)
  {
    Composite titleComposite = toolkit.createComposite(commentComposite);
    commentComposite.setTextClient(titleComposite);
    RowLayout rowLayout = new RowLayout();
    pack = true;
    marginLeft = 0;
    marginBottom = 0;
    marginTop = 0;
    EditorUtil.center(rowLayout);
    titleComposite.setLayout(rowLayout);
    titleComposite.setBackground(null);
    
    ImageHyperlink expandCommentHyperlink = createTitleHyperLink(toolkit, titleComposite, taskComment);
    expandCommentHyperlink.addHyperlinkListener(new HyperlinkAdapter()
    {
      public void linkActivated(HyperlinkEvent e)
      {
        CommonFormUtil.setExpanded(commentComposite, !commentComposite.isExpanded());
      }
    });
    ToolBarManager toolBarManagerTitle = new ToolBarManager(8388608);
    this$0.addActionsToToolbarTitle(toolBarManagerTitle, taskComment, this);
    toolBarManagerTitle.createControl(titleComposite);
    
    Composite buttonComposite = toolkit.createComposite(titleComposite);
    RowLayout buttonCompLayout = new RowLayout();
    marginBottom = 0;
    marginTop = 0;
    buttonComposite.setLayout(buttonCompLayout);
    buttonComposite.setBackground(null);
    buttonComposite.setVisible(commentComposite.isExpanded());
    
    ToolBarManager toolBarManagerButton = new ToolBarManager(8388608);
    this$0.addActionsToToolbarButton(toolBarManagerButton, taskComment, this);
    toolBarManagerButton.createControl(buttonComposite);
    
    return buttonComposite;
  }
  
  private ImageHyperlink createTitleHyperLink(FormToolkit toolkit, Composite toolbarComp, ITaskComment taskComment)
  {
    ImageHyperlink formHyperlink = toolkit.createImageHyperlink(toolbarComp, 0);
    formHyperlink.setBackground(null);
    formHyperlink.setForeground(toolkit.getColors().getColor("org.eclipse.ui.forms.TITLE"));
    IRepositoryPerson author = taskComment.getAuthor();
    if ((author != null) && 
      (author.getPersonId().equalsIgnoreCase(this$0.getTaskEditorPage().getTaskRepository().getUserName()))) {
      formHyperlink.setImage(CommonImages.getImage(CommonImages.PERSON_ME_NARROW));
    } else {
      formHyperlink.setImage(CommonImages.getImage(CommonImages.PERSON_NARROW));
    }
    StringBuilder sb = new StringBuilder();
    if (taskComment.getNumber() >= 0)
    {
      sb.append(taskComment.getNumber());
      sb.append(": ");
    }
    String toolTipText = "";
    if (author != null) {
      if (author.getName() != null)
      {
        sb.append(author.getName());
        toolTipText = author.getPersonId();
      }
      else
      {
        sb.append(author.getPersonId());
      }
    }
    if (taskComment.getCreationDate() != null)
    {
      sb.append(", ");
      sb.append(EditorUtil.formatDateTime(taskComment.getCreationDate()));
    }
    formHyperlink.setFont(commentComposite.getFont());
    formHyperlink.setToolTipText(toolTipText);
    formHyperlink.setText(sb.toString());
    formHyperlink.setEnabled(true);
    formHyperlink.setUnderlined(false);
    return formHyperlink;
  }
  
  private void expandComment(FormToolkit toolkit, Composite composite, boolean expanded)
  {
    buttonComposite.setVisible(expanded);
    if ((expanded) && (composite.getData("viewer") == null))
    {
      TaskAttribute textAttribute = this$0.getTaskData().getAttributeMapper().getAssoctiatedAttribute(
        taskComment.getTaskAttribute());
      this.editor = TaskEditorCommentPart.access$3(this$0, textAttribute);
      if (this.editor != null)
      {
        this.editor.setDecorationEnabled(false);
        this.editor.createControl(composite, toolkit);
        this.editor.getControl().addMouseListener(new MouseAdapter()
        {
          public void mouseDown(MouseEvent e)
          {
            this$0.getTaskEditorPage().selectionChanged(taskComment);
          }
        });
        composite.setData("viewer", this.editor);
        
        this$0.getTaskEditorPage().getAttributeEditorToolkit().adapt(this.editor);
        this$0.getTaskEditorPage().reflow();
      }
    }
    else if ((!expanded) && (composite.getData("viewer") != null))
    {
      AbstractAttributeEditor editor = (AbstractAttributeEditor)composite.getData("viewer");
      editor.getControl().setMenu(null);
      editor.getControl().dispose();
      composite.setData("viewer", null);
      this$0.getTaskEditorPage().reflow();
    }
    this$0.getTaskEditorPage().selectionChanged(taskComment);
  }
  
  public boolean isExpanded()
  {
    return (commentComposite != null) && (commentComposite.isExpanded());
  }
  
  public void setExpanded(boolean expanded)
  {
    if ((commentComposite != null) && (commentComposite.isExpanded() != expanded)) {
      CommonFormUtil.setExpanded(commentComposite, expanded);
    }
  }
  
  public AbstractAttributeEditor getEditor()
  {
    return editor;
  }
  
  public TaskAttribute getTaskAttribute()
  {
    return commentAttribute;
  }
  
  public TaskComment getTaskComment()
  {
    return taskComment;
  }
  
  public Control getControl()
  {
    return commentComposite;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorCommentPart.CommentViewer
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.ui.editors;

import org.eclipse.mylyn.commons.workbench.forms.CommonFormUtil;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.ExpandableComposite;

class TaskEditorCommentPart$CommentViewer$2
  extends HyperlinkAdapter
{
  TaskEditorCommentPart$CommentViewer$2(TaskEditorCommentPart.CommentViewer paramCommentViewer, ExpandableComposite paramExpandableComposite) {}
  
  public void linkActivated(HyperlinkEvent e)
  {
    CommonFormUtil.setExpanded(val$commentComposite, !val$commentComposite.isExpanded());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorCommentPart.CommentViewer.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.ui.editors;

class TaskEditorRichTextPart$4
  implements RichTextEditor.StateChangedListener
{
  TaskEditorRichTextPart$4(TaskEditorRichTextPart paramTaskEditorRichTextPart) {}
  
  /* Error */
  public void stateChanged(RichTextEditor.StateChangedEvent event)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 49	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart$4:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;
    //   4: iconst_1
    //   5: invokestatic 52	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart:access$2	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;Z)V
    //   8: aload_0
    //   9: getfield 49	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart$4:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;
    //   12: invokestatic 53	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart:access$1	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;)Lorg/eclipse/jface/action/Action;
    //   15: aload_1
    //   16: getfield 48	org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$StateChangedEvent:state	Lorg/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$State;
    //   19: getstatic 47	org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$State:BROWSER	Lorg/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor$State;
    //   22: if_acmpne +7 -> 29
    //   25: iconst_1
    //   26: goto +4 -> 30
    //   29: iconst_0
    //   30: invokevirtual 51	org/eclipse/jface/action/Action:setChecked	(Z)V
    //   33: goto +14 -> 47
    //   36: astore_2
    //   37: aload_0
    //   38: getfield 49	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart$4:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;
    //   41: iconst_0
    //   42: invokestatic 52	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart:access$2	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;Z)V
    //   45: aload_2
    //   46: athrow
    //   47: aload_0
    //   48: getfield 49	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart$4:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;
    //   51: iconst_0
    //   52: invokestatic 52	org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart:access$2	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart;Z)V
    //   55: return
    // Line number table:
    //   Java source line #220	-> byte code offset #0
    //   Java source line #221	-> byte code offset #8
    //   Java source line #222	-> byte code offset #36
    //   Java source line #223	-> byte code offset #37
    //   Java source line #224	-> byte code offset #45
    //   Java source line #223	-> byte code offset #47
    //   Java source line #225	-> byte code offset #55
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	56	0	this	4
    //   0	56	1	event	RichTextEditor.StateChangedEvent
    //   36	10	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	36	36	finally
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorRichTextPart.4
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.ui.editors;

import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;

class PlanningPart$12
  extends ExpansionAdapter
{
  PlanningPart$12(PlanningPart paramPlanningPart) {}
  
  public void expansionStateChanging(ExpansionEvent event)
  {
    PlanningPart.access$10(this$0, event.getState());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.editors.PlanningPart.12
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.ui.editors;

import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskAttachmentWizard.Mode;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class TaskEditorAttachmentPart$4
  extends SelectionAdapter
{
  TaskEditorAttachmentPart$4(TaskEditorAttachmentPart paramTaskEditorAttachmentPart) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    EditorUtil.openNewAttachmentWizard(this$0.getTaskEditorPage(), TaskAttachmentWizard.Mode.SCREENSHOT, null);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorAttachmentPart.4
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.ui.editors;

import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;

class RichTextEditor$2
  implements DisposeListener
{
  RichTextEditor$2(RichTextEditor paramRichTextEditor, SourceViewerDecorationSupport paramSourceViewerDecorationSupport) {}
  
  public void widgetDisposed(DisposeEvent e)
  {
    val$support.uninstall();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.editors.RichTextEditor.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.ui.editors;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.ByteArrayInputStream;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.mylyn.commons.identity.core.Account;
import org.eclipse.mylyn.commons.identity.core.IIdentity;
import org.eclipse.mylyn.commons.identity.core.IIdentityService;
import org.eclipse.mylyn.commons.identity.core.IProfileImage;
import org.eclipse.mylyn.commons.identity.core.spi.ProfileImage;
import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.IRepositoryPerson;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMetaData;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
import org.eclipse.mylyn.tasks.ui.editors.LayoutHint;
import org.eclipse.mylyn.tasks.ui.editors.LayoutHint.ColumnSpan;
import org.eclipse.mylyn.tasks.ui.editors.LayoutHint.RowSpan;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.forms.widgets.FormToolkit;

public class UserAttributeEditor
  extends AbstractAttributeEditor
{
  private static final int IMAGE_SIZE = 48;
  private Label label;
  private IIdentity identity;
  private final PropertyChangeListener imageListener = new PropertyChangeListener()
  {
    public void propertyChange(PropertyChangeEvent event)
    {
      if (event.getPropertyName().equals("image"))
      {
        final ProfileImage profileImage = (ProfileImage)event.getNewValue();
        Display.getDefault().asyncExec(new Runnable()
        {
          public void run()
          {
            if (!label.isDisposed()) {
              updateImage(profileImage);
            }
          }
        });
      }
    }
  };
  private Image image;
  
  public UserAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute)
  {
    super(manager, taskAttribute);
    setLayoutHint(new LayoutHint(LayoutHint.RowSpan.SINGLE, LayoutHint.ColumnSpan.SINGLE));
  }
  
  protected Image updateImage(IProfileImage profileImage)
  {
    if (image != null) {
      image.dispose();
    }
    ImageData data;
    if (profileImage != null)
    {
      ImageData data = new ImageData(new ByteArrayInputStream(profileImage.getData()));
      if ((width != 48) || (height != 48)) {
        data = data.scaledTo(48, 48);
      }
    }
    else
    {
      data = CommonImages.PERSON_LARGE.getImageData();
    }
    image = new Image(label.getDisplay(), data);
    label.setImage(image);
    return image;
  }
  
  public void createControl(Composite parent, FormToolkit toolkit)
  {
    label = new Label(parent, 0);
    label.setData("FormWidgetFactory.drawBorder", "treeBorder");
    label.addDisposeListener(new DisposeListener()
    {
      public void widgetDisposed(DisposeEvent e)
      {
        if (image != null) {
          image.dispose();
        }
        if (identity != null) {
          identity.removePropertyChangeListener(imageListener);
        }
      }
    });
    refresh();
    toolkit.adapt(label, false, false);
    setControl(label);
  }
  
  public Image getValue()
  {
    return image;
  }
  
  protected boolean shouldAutoRefresh()
  {
    return false;
  }
  
  public void refresh()
  {
    if (label.isDisposed()) {
      return;
    }
    if (identity != null) {
      identity.removePropertyChangeListener(imageListener);
    }
    if ("person".equals(getTaskAttribute().getMetaData().getType()))
    {
      IRepositoryPerson person = getTaskAttribute().getTaskData()
        .getAttributeMapper()
        .getRepositoryPerson(getTaskAttribute());
      label.setToolTipText(getLabel() + " " + person.toString());
    }
    else
    {
      label.setToolTipText(getDescription());
    }
    Account account = TasksUiInternal.getAccount(getTaskAttribute());
    IIdentityService identityService = TasksUiPlugin.getDefault().getIdentityService();
    if (identityService != null)
    {
      identity = identityService.getIdentity(account);
      identity.addPropertyChangeListener(imageListener);
      Future<IProfileImage> result = identity.requestImage(48, 48);
      if (result.isDone()) {
        try
        {
          updateImage((IProfileImage)result.get(0L, TimeUnit.SECONDS));
        }
        catch (Exception localException)
        {
          updateImage(null);
        }
      } else {
        updateImage(null);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.editors.UserAttributeEditor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.ui.editors;

import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorExtension;

public class TaskEditorExtensionReader
{
  private static final String CONNECTOR_KIND = "connectorKind";
  public static final String ATTR_ID = "id";
  public static final String ATTR_NAME = "name";
  public static final String EXTENSION_TASK_EDITOR_EXTENSIONS = "org.eclipse.mylyn.tasks.ui.taskEditorExtensions";
  private static final String REPOSITORY_ASSOCIATION = "repositoryAssociation";
  private static final String TASK_EDITOR_EXTENSION = "taskEditorExtension";
  
  public static void initExtensions()
  {
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    
    IExtensionPoint editorExtensionPoint = registry.getExtensionPoint("org.eclipse.mylyn.tasks.ui.taskEditorExtensions");
    IExtension[] editorExtensions = editorExtensionPoint.getExtensions();
    IExtension[] arrayOfIExtension1;
    int j = (arrayOfIExtension1 = editorExtensions).length;
    for (int i = 0; i < j; i++)
    {
      IExtension extension = arrayOfIExtension1[i];
      IConfigurationElement[] elements = extension.getConfigurationElements();
      IConfigurationEleme
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79

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-2019. Infinite Loop Ltd