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

tion = new TaskEditorPlanningPart.NotesAction(TaskEditorPlanningPart.this);
        notesAction.setEnabled(needsNotes());
        toolBarManager.add(notesAction);
        toolBarManager.add(getMaximizePartAction());
      }
    };
  }
  
  public void initialize(AbstractTaskEditorPage taskEditorPage)
  {
    super.initialize(taskEditorPage);
    boolean needsDueDate = !taskEditorPage.getConnector().hasRepositoryDueDate(taskEditorPage.getTaskRepository(), 
      taskEditorPage.getTask(), getTaskData());
    CommonTextSupport textSupport = (CommonTextSupport)getTaskEditorPage().getAdapter(CommonTextSupport.class);
    
    part.initialize(taskEditorPage.getManagedForm(), taskEditorPage.getTaskRepository(), 
      (AbstractTask)taskEditorPage.getTask(), needsDueDate, taskEditorPage, textSupport);
    part.setNeedsNotes(!getModel().getTaskData().isNew());
    part.setAlwaysExpand(getModel().getTaskData().isNew());
  }
  
  public void createControl(Composite parent, FormToolkit toolkit)
  {
    part.createControl(parent, toolkit);
    part.getSection().setToolTipText(Messages.TaskEditorPlanningPart_TaskEditorPlanningPart_tooltip);
    setSection(toolkit, part.getSection());
  }
  
  protected Control getLayoutControl()
  {
    return part.getLayoutControl();
  }
  
  public void commit(boolean onSave)
  {
    super.commit(onSave);
    part.commit(onSave);
  }
  
  public boolean isDirty()
  {
    return (super.isDirty()) || (part.isDirty());
  }
  
  public void dispose()
  {
    part.dispose();
  }
  
  public PlanningPart getPlanningPart()
  {
    return part;
  }
}

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

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.ui.CommonUiUtil;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
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.swt.widgets.Label;
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.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;

public abstract class AbstractTaskEditorSection
  extends AbstractTaskEditorPart
{
  private Section section;
  private final List<AbstractTaskEditorPart> subParts = new ArrayList();
  
  public void addSubPart(String path, AbstractTaskEditorPart part)
  {
    subParts.add(part);
  }
  
  protected abstract Control createContent(FormToolkit paramFormToolkit, Composite paramComposite);
  
  public void createControl(Composite parent, final FormToolkit toolkit)
  {
    boolean expand = shouldExpandOnCreate();
    section = createSection(parent, toolkit, expand);
    if (expand) {
      createSectionClient(toolkit, section);
    } else {
      section.addExpansionListener(new ExpansionAdapter()
      {
        public void expansionStateChanged(ExpansionEvent event)
        {
          if (section.getClient() == null)
          {
            AbstractTaskEditorSection.this.createSectionClient(toolkit, section);
            getTaskEditorPage().reflow();
          }
        }
      });
    }
    setSection(toolkit, section);
  }
  
  private void createInfoOverlay(Composite composite, Section section, FormToolkit toolkit)
  {
    String text = getInfoOverlayText();
    if (text == null) {
      return;
    }
    final Label label = toolkit.createLabel(composite, CommonUiUtil.toLabel(text));
    label.setForeground(toolkit.getColors().getColor("org.eclipse.ui.forms.TITLE"));
    label.setBackground(null);
    label.setVisible(!section.isExpanded());
    
    section.addExpansionListener(new ExpansionAdapter()
    {
      public void expansionStateChanging(ExpansionEvent e)
      {
        label.setVisible(!e.getState());
      }
    });
  }
  
  private void createSectionClient(final FormToolkit toolkit, Section section)
  {
    if (subParts.size() > 0)
    {
      final Composite sectionClient = toolkit.createComposite(section);
      GridLayout layout = EditorUtil.createSectionClientLayout();
      marginHeight = 0;
      marginWidth = 0;
      sectionClient.setLayout(layout);
      
      Control content = createContent(toolkit, sectionClient);
      GridDataFactory.fillDefaults().align(4, 128).grab(true, false).applyTo(content);
      section.setClient(sectionClient);
      for (final AbstractTaskEditorPart part : subParts) {
        SafeRunner.run(new ISafeRunnable()
        {
          public void handleException(Throwable e)
          {
            StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", 
              "Error creating task editor part: \"" + part.getPartId() + "\"", e));
          }
          
          public void run()
            throws Exception
          {
            part.createControl(sectionClient, toolkit);
            if (part.getControl() != null) {
              GridDataFactory.fillDefaults().align(4, 128).grab(true, false).applyTo(part.getControl());
            }
          }
        });
      }
    }
    else
    {
      Control content = createContent(toolkit, section);
      section.setClient(content);
    }
  }
  
  protected String getInfoOverlayText()
  {
    return null;
  }
  
  public Section getSection()
  {
    return section;
  }
  
  public void removeSubPart(AbstractTaskEditorPart part)
  {
    subParts.remove(part);
  }
  
  protected void setSection(FormToolkit toolkit, Section section)
  {
    if (section.getTextClient() == null)
    {
      ToolBarManager toolBarManager = new ToolBarManager(8388608);
      fillToolBar(toolBarManager);
      if (toolBarManager.getSize() > 0)
      {
        Composite toolbarComposite = toolkit.createComposite(section);
        toolbarComposite.setBackground(null);
        RowLayout rowLayout = new RowLayout();
        marginLeft = 0;
        marginRight = 0;
        marginTop = 0;
        marginBottom = 0;
        center = true;
        toolbarComposite.setLayout(rowLayout);
        
        createInfoOverlay(toolbarComposite, section, toolkit);
        
        toolBarManager.createControl(toolbarComposite);
        clientVerticalSpacing = 0;
        descriptionVerticalSpacing = 0;
        section.setTextClient(toolbarComposite);
      }
    }
    setControl(section);
  }
  
  protected abstract boolean shouldExpandOnCreate();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.editors.AbstractTaskEditorSection
 * 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.ICoolBarManager;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.mylyn.commons.ui.SelectionProviderAdapter;
import org.eclipse.mylyn.commons.workbench.WorkbenchActionSupport;
import org.eclipse.mylyn.commons.workbench.WorkbenchActionSupport.WorkbenchActionCallback;
import org.eclipse.mylyn.internal.tasks.ui.actions.NewTaskFromSelectionAction;
import org.eclipse.mylyn.internal.tasks.ui.actions.SynchronizeEditorAction;
import org.eclipse.mylyn.internal.tasks.ui.actions.TaskEditorActionGroup;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.forms.editor.IFormPage;
import org.eclipse.ui.part.MultiPageEditorActionBarContributor;

public class TaskEditorActionContributor
  extends MultiPageEditorActionBarContributor
  implements ISelectionChangedListener
{
  private TaskEditor editor;
  private final WorkbenchActionSupport actionSupport;
  private final SelectionProviderAdapterExtension selectionProvider;
  private final TaskEditorActionGroup actionGroup;
  
  private final class SelectionProviderAdapterExtension
    extends SelectionProviderAdapter
    implements ISelectionChangedListener
  {
    private SelectionProviderAdapterExtension() {}
    
    public ISelection getSelection()
    {
      if ((editor != null) && (editor.getSite().getSelectionProvider() != null)) {
        return editor.getSite().getSelectionProvider().getSelection();
      }
      return StructuredSelection.EMPTY;
    }
    
    public void selectionChanged(SelectionChangedEvent event)
    {
      super.selectionChanged(event);
    }
  }
  
  private class EditorPageCallback
    extends WorkbenchActionSupport.WorkbenchActionCallback
  {
    private EditorPageCallback() {}
    
    public boolean canPerformAction(String actionId, Control control)
    {
      IFormPage activePage = TaskEditorActionContributor.this.getActivePage();
      if ((activePage instanceof AbstractTaskEditorPage))
      {
        AbstractTaskEditorPage page = (AbstractTaskEditorPage)activePage;
        return page.canPerformAction(actionId);
      }
      if (activePage != null)
      {
        WorkbenchActionSupport.WorkbenchActionCallback callback = (WorkbenchActionSupport.WorkbenchActionCallback)activePage.getAdapter(WorkbenchActionSupport.WorkbenchActionCallback.class);
        if (callback != null) {
          return callback.canPerformAction(actionId, control);
        }
      }
      return super.canPerformAction(actionId, control);
    }
    
    public void doAction(String actionId, Control control)
    {
      IFormPage activePage = TaskEditorActionContributor.this.getActivePage();
      if ((activePage instanceof AbstractTaskEditorPage))
      {
        AbstractTaskEditorPage page = (AbstractTaskEditorPage)activePage;
        page.doAction(actionId);
        return;
      }
      if (activePage != null)
      {
        WorkbenchActionSupport.WorkbenchActionCallback callback = (WorkbenchActionSupport.WorkbenchActionCallback)activePage.getAdapter(WorkbenchActionSupport.WorkbenchActionCallback.class);
        if (callback != null)
        {
          callback.doAction(actionId, control);
          return;
        }
      }
      super.doAction(actionId, control);
    }
    
    public Control getFocusControl()
    {
      IFormPage page = TaskEditorActionContributor.this.getActivePage();
      return page != null ? EditorUtil.getFocusControl(page) : null;
    }
    
    public ISelection getSelection()
    {
      return selectionProvider.getSelection();
    }
  }
  
  public TaskEditorActionContributor()
  {
    actionSupport = new WorkbenchActionSupport();
    actionSupport.setCallback(new EditorPageCallback(null));
    selectionProvider = new SelectionProviderAdapterExtension(null);
    actionGroup = new TaskEditorActionGroup(actionSupport);
  }
  
  public void contextMenuAboutToShow(IMenuManager mng)
  {
    IFormPage page = getActivePage();
    boolean addClipboard = ((page instanceof TaskPlanningEditor)) || ((page instanceof AbstractTaskEditorPage));
    contextMenuAboutToShow(mng, addClipboard);
  }
  
  public void contextMenuAboutToShow(IMenuManager manager, boolean addClipboard)
  {
    actionGroup.fillContextMenu(manager, editor, addClipboard);
  }
  
  public void contributeToCoolBar(ICoolBarManager cbm) {}
  
  public void contributeToMenu(IMenuManager mm) {}
  
  public void contributeToStatusLine(IStatusLineManager slm) {}
  
  public void contributeToToolBar(IToolBarManager tbm) {}
  
  public void dispose()
  {
    actionGroup.setSelectionProvider(null);
  }
  
  public void forceActionsEnabled()
  {
    actionSupport.forceEditActionsEnabled();
  }
  
  private IFormPage getActivePage()
  {
    return editor != null ? editor.getActivePageInstance() : null;
  }
  
  public TaskEditor getEditor()
  {
    return editor;
  }
  
  public void init(IActionBars bars, IWorkbenchPage page)
  {
    super.init(bars, page);
    actionSupport.install(bars);
    bars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), actionGroup.getSynchronizeEditorAction());
  }
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    actionSupport.selectionChanged(event);
    actionGroup.getNewTaskFromSelectionAction().selectionChanged(event.getSelection());
  }
  
  public void setActiveEditor(IEditorPart activeEditor)
  {
    if (editor != null) {
      editor.getSite().getSelectionProvider().removeSelectionChangedListener(selectionProvider);
    }
    if ((activeEditor instanceof TaskEditor))
    {
      editor = ((TaskEditor)activeEditor);
      editor.getSite().getSelectionProvider().addSelectionChangedListener(selectionProvider);
      actionGroup.getSynchronizeEditorAction().selectionChanged(new StructuredSelection(editor));
      updateSelectableActions(selectionProvider.getSelection());
    }
    else
    {
      actionGroup.getSynchronizeEditorAction().selectionChanged(StructuredSelection.EMPTY);
      editor = null;
    }
  }
  
  public void setActivePage(IEditorPart activePage)
  {
    updateSelectableActions(selectionProvider.getSelection());
  }
  
  public void updateSelectableActions(ISelection selection)
  {
    if (editor != null)
    {
      actionSupport.updateActions(selection);
      actionGroup.getNewTaskFromSelectionAction().selectionChanged(selection);
    }
  }
}

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

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
import org.eclipse.mylyn.commons.workbench.forms.CommonFormUtil;
import org.eclipse.mylyn.internal.tasks.core.ITaskJobFactory;
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskDiffUtil;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.UpdateRepositoryConfigurationAction;
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.core.sync.TaskJob;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
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.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.mylyn.tasks.ui.editors.TaskEditor;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;

public abstract class AbstractTaskEditorAttributeSection
  extends AbstractTaskEditorSection
{
  private static final int LABEL_WIDTH = 110;
  private static final int COLUMN_WIDTH = 140;
  private static final int COLUMN_GAP = 20;
  private static final int MULTI_COLUMN_WIDTH = 420;
  private static final int MULTI_ROW_HEIGHT = 55;
  private List<AbstractAttributeEditor> attributeEditors;
  private boolean hasIncoming;
  private Composite attributesComposite;
  private boolean needsRefresh;
  
  public void createControl(Composite parent, FormToolkit toolkit)
  {
    initialize();
    super.createControl(parent, toolkit);
  }
  
  public boolean hasIncoming()
  {
    return hasIncoming;
  }
  
  public void selectReveal(TaskAttribute attribute)
  {
    if (attribute == null) {
      return;
    }
    if (!getSection().isExpanded()) {
      CommonFormUtil.setExpanded(getSection(), true);
    }
    EditorUtil.reveal(getTaskEditorPage().getManagedForm().getForm(), attribute.getId());
  }
  
  public boolean setFormInput(Object input)
  {
    if ((input instanceof String))
    {
      String text = (String)input;
      Collection<TaskAttribute> attributes = getAttributes();
      for (TaskAttribute attribute : attributes) {
        if (text.equals(attribute.getId())) {
          selectReveal(attribute);
        }
      }
    }
    return super.setFormInput(input);
  }
  
  private void createAttributeControls(Composite attributesComposite, FormToolkit toolkit, int columnCount)
  {
    int currentColumn = 1;
    int currentPriority = 0;
    for (AbstractAttributeEditor attributeEditor : attributeEditors)
    {
      int priority = attributeEditor.getLayoutHint() != null ? 
        attributeEditor.getLayoutHint().getPriority() : 
        10;
      if (priority != currentPriority)
      {
        currentPriority = priority;
        if (currentColumn > 1)
        {
          while (currentColumn <= columnCount)
          {
            getManagedForm().getToolkit().createLabel(attributesComposite, "");
            currentColumn++;
          }
          currentColumn = 1;
        }
      }
      if (attributeEditor.hasLabel())
      {
        attributeEditor.createLabelControl(attributesComposite, toolkit);
        Label label = attributeEditor.getLabelControl();
        String text = label.getText();
        String shortenText = TaskDiffUtil.shortenText(label, text, 110);
        label.setText(shortenText);
        if (!text.equals(shortenText)) {
          label.setToolTipText(text);
        }
        GridData gd = GridDataFactory.fillDefaults()
          .align(131072, 16777216)
          .hint(110, -1)
          .create();
        if (currentColumn > 1)
        {
          horizontalIndent = 20;
          widthHint = 130;
        }
        label.setLayoutData(gd);
        currentColumn++;
      }
      attributeEditor.createControl(attributesComposite, toolkit);
      LayoutHint layoutHint = attributeEditor.getLayoutHint();
      GridData gd = new GridData(4, 16777216, false, false);
      LayoutHint.RowSpan rowSpan = (layoutHint != null) && (rowSpan != null) ? rowSpan : LayoutHint.RowSpan.SINGLE;
      LayoutHint.ColumnSpan columnSpan = (layoutHint != null) && (columnSpan != null) ? 
        columnSpan : 
        LayoutHint.ColumnSpan.SINGLE;
      if ((rowSpan == LayoutHint.RowSpan.SINGLE) && (columnSpan == LayoutHint.ColumnSpan.SINGLE))
      {
        widthHint = 140;
        horizontalSpan = 1;
      }
      else
      {
        if (rowSpan == LayoutHint.RowSpan.MULTIPLE) {
          heightHint = 55;
        }
        if (columnSpan == LayoutHint.ColumnSpan.SINGLE)
        {
          widthHint = 140;
          horizontalSpan = 1;
        }
        else
        {
          widthHint = 420;
          horizontalSpan = (columnCount - currentColumn + 1);
        }
      }
      attributeEditor.getControl().setLayoutData(gd);
      
      getTaskEditorPage().getAttributeEditorToolkit().adapt(attributeEditor);
      
      currentColumn += horizontalSpan;
      currentColumn %= columnCount;
    }
  }
  
  private void initialize()
  {
    attributeEditors = new ArrayList();
    hasIncoming = false;
    
    Collection<TaskAttribute> attributes = getAttributes();
    for (TaskAttribute attribute : attributes)
    {
      AbstractAttributeEditor attributeEditor = createAttributeEditor(attribute);
      if (attributeEditor != null)
      {
        attributeEditors.add(attributeEditor);
        if (getModel().hasIncomingChanges(attribute)) {
          hasIncoming = true;
        }
      }
    }
    Comparator<AbstractAttributeEditor> attributeSorter = createAttributeEditorSorter();
    if (attributeSorter != null) {
      Collections.sort(attributeEditors, attributeSorter);
    }
  }
  
  protected Comparator<AbstractAttributeEditor> createAttributeEditorSorter()
  {
    new Comparator()
    {
      public int compare(AbstractAttributeEditor o1, AbstractAttributeEditor o2)
      {
        int p1 = o1.getLayoutHint() != null ? o1.getLayoutHint().getPriority() : 10;
        int p2 = o2.getLayoutHint() != null ? o2.getLayoutHint().getPriority() : 10;
        return p1 - p2;
      }
    };
  }
  
  protected Control createContent(FormToolkit toolkit, Composite parent)
  {
    attributesComposite = toolkit.createComposite(parent);
    attributesComposite.addListener(3, new Listener()
    {
      public void handleEvent(Event event)
      {
        Control focus = display.getFocusControl();
        if (((focus instanceof Text)) && (!((Text)focus).getEditable())) {
          getManagedForm().getForm().setFocus();
        }
      }
    });
    GridLayout attributesLayout = EditorUtil.createSectionClientLayout();
    numColumns = 4;
    horizontalSpacing = 9;
    verticalSpacing = 6;
    attributesComposite.setLayout(attributesLayout);
    
    GridData attributesData = new GridData(1808);
    horizontalSpan = 1;
    grabExcessVerticalSpace = false;
    attributesComposite.setLayoutData(attributesData);
    
    createAttributeControls(attributesComposite, toolkit, numColumns);
    toolkit.paintBordersFor(attributesComposite);
    
    return attributesComposite;
  }
  
  protected IAction doCreateRefreshAction()
  {
    UpdateRepositoryConfigurationAction repositoryConfigRefresh = new UpdateRepositoryConfigurationAction()
    {
      public void run()
      {
        getTaskEditorPage().showEditorBusy(true);
        final TaskJob job = TasksUiInternal.getJobFactory().createUpdateRepositoryConfigurationJob(
          getTaskEditorPage().getConnector(), getTaskEditorPage().getTaskRepository(), 
          getTaskEditorPage().getTask());
        job.addJobChangeListener(new JobChangeAdapter()
        {
          public void done(IJobChangeEvent event)
          {
            PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
            {
              public void run()
              {
                getTaskEditorPage().showEditorBusy(false);
                if (val$job.getStatus() != null) {
                  getTaskEditorPage().getTaskEditor().setStatus(
                    Messages.TaskEditorAttributePart_Updating_of_repository_configuration_failed, 
                    Messages.TaskEditorAttributePart_Update_Failed, val$job.getStatus());
                } else {
                  getTaskEditorPage().refresh();
                }
              }
            });
          }
        });
        job.setUser(true);
        
        job.setProperty(WorkbenchUtil.SHOW_IN_TASKBAR_ICON_PROPERTY, Boolean.TRUE);
        job.setPriority(10);
        job.schedule();
      }
    };
    repositoryConfigRefresh.setImageDescriptor(TasksUiImages.REPOSITORY_SYNCHRONIZE_SMALL);
    repositoryConfigRefresh.selectionChanged(new StructuredSelection(getTaskEditorPage().getTaskRepository()));
    repositoryConfigRefresh.setToolTipText(Messages.TaskEditorAttributePart_Refresh_Attributes);
    return repositoryConfigRefresh;
  }
  
  protected void fillToolBar(ToolBarManager toolBar)
  {
    if (needsRefresh())
    {
      IAction repositoryConfigRefresh = doCreateRefreshAction();
      toolBar.add(repositoryConfigRefresh);
    }
  }
  
  protected abstract Collection<TaskAttribute> getAttributes();
  
  protected String getInfoOverlayText()
  {
    StringBuilder sb = new StringBuilder();
    List<TaskAttribute> overlayAttributes = getOverlayAttributes();
    for (TaskAttribute attribute : overlayAttributes)
    {
      String label = getModel().getTaskData().getAttributeMapper().getValueLabel(attribute);
      if ((label != null) && 
        (sb.length() > 0)) {
        sb.append(" / ");
      }
      sb.append(label);
    }
    return sb.length() > 0 ? sb.toString() : null;
  }
  
  protected abstract List<TaskAttribute> getOverlayAttributes();
  
  protected boolean needsRefresh()
  {
    return needsRefresh;
  }
  
  protected void setNeedsRefresh(boolean needsRefresh)
  {
    this.needsRefresh = needsRefresh;
  }
  
  protected boolean shouldExpandOnCreate()
  {
    return (getTaskData().isNew()) || (hasIncoming);
  }
}

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

import java.util.List;
import org.eclipse.mylyn.commons.ui.dialogs.IInPlaceDialogListener;
import org.eclipse.mylyn.commons.workbench.InPlaceCheckBoxTreeDialog;

class CheckboxMultiSelectAttributeEditor$1$1
  implements IInPlaceDialogListener
{
  CheckboxMultiSelectAttributeEditor$1$1(CheckboxMultiSelectAttributeEditor.1 param1, InPlaceCheckBoxTreeDialog paramInPlaceCheckBoxTreeDialog, List paramList) {}
  
  /* Error */
  public void buttonPressed(org.eclipse.mylyn.commons.ui.dialogs.InPlaceDialogEvent event)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 68	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1$1:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1;
    //   4: invokestatic 79	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1:access$0	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1;)Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor;
    //   7: iconst_1
    //   8: invokestatic 78	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor:access$2	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor;Z)V
    //   11: aload_1
    //   12: invokevirtual 74	org/eclipse/mylyn/commons/ui/dialogs/InPlaceDialogEvent:getReturnCode	()I
    //   15: ifne +60 -> 75
    //   18: aload_0
    //   19: getfield 67	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1$1:val$selectionDialog	Lorg/eclipse/mylyn/commons/workbench/InPlaceCheckBoxTreeDialog;
    //   22: invokevirtual 75	org/eclipse/mylyn/commons/workbench/InPlaceCheckBoxTreeDialog:getSelectedValues	()Ljava/util/Set;
    //   25: astore_2
    //   26: new 30	java/util/HashSet
    //   29: dup
    //   30: aload_0
    //   31: getfield 66	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1$1:val$values	Ljava/util/List;
    //   34: invokespecial 73	java/util/HashSet:<init>	(Ljava/util/Collection;)V
    //   37: aload_2
    //   38: invokevirtual 72	java/util/HashSet:equals	(Ljava/lang/Object;)Z
    //   41: ifne +115 -> 156
    //   44: aload_0
    //   45: getfield 68	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1$1:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1;
    //   48: invokestatic 79	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1:access$0	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1;)Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor;
    //   51: new 29	java/util/ArrayList
    //   54: dup
    //   55: aload_2
    //   56: invokespecial 70	java/util/ArrayList:<init>	(Ljava/util/Collection;)V
    //   59: invokevirtual 77	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor:setValues	(Ljava/util/List;)V
    //   62: aload_0
    //   63: getfield 68	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1$1:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1;
    //   66: invokestatic 79	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1:access$0	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1;)Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor;
    //   69: invokevirtual 76	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor:refresh	()V
    //   72: goto +84 -> 156
    //   75: aload_1
    //   76: invokevirtual 74	org/eclipse/mylyn/commons/ui/dialogs/InPlaceDialogEvent:getReturnCode	()I
    //   79: sipush 1025
    //   82: if_icmpne +74 -> 156
    //   85: new 30	java/util/HashSet
    //   88: dup
    //   89: invokespecial 71	java/util/HashSet:<init>	()V
    //   92: astore_2
    //   93: new 30	java/util/HashSet
    //   96: dup
    //   97: aload_0
    //   98: getfield 66	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1$1:val$values	Ljava/util/List;
    //   101: invokespecial 73	java/util/HashSet:<init>	(Ljava/util/Collection;)V
    //   104: aload_2
    //   105: invokevirtual 72	java/util/HashSet:equals	(Ljava/lang/Object;)Z
    //   108: ifne +48 -> 156
    //   111: aload_0
    //   112: getfield 68	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1$1:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1;
    //   115: invokestatic 79	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1:access$0	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1;)Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor;
    //   118: new 29	java/util/ArrayList
    //   121: dup
    //   122: aload_2
    //   123: invokespecial 70	java/util/ArrayList:<init>	(Ljava/util/Collection;)V
    //   126: invokevirtual 77	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor:setValues	(Ljava/util/List;)V
    //   129: aload_0
    //   130: getfield 68	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1$1:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1;
    //   133: invokestatic 79	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1:access$0	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1;)Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor;
    //   136: invokevirtual 76	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor:refresh	()V
    //   139: goto +17 -> 156
    //   142: astore_3
    //   143: aload_0
    //   144: getfield 68	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1$1:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1;
    //   147: invokestatic 79	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1:access$0	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1;)Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor;
    //   150: iconst_0
    //   151: invokestatic 78	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor:access$2	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor;Z)V
    //   154: aload_3
    //   155: athrow
    //   156: aload_0
    //   157: getfield 68	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1$1:this$1	Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1;
    //   160: invokestatic 79	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1:access$0	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor$1;)Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor;
    //   163: iconst_0
    //   164: invokestatic 78	org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor:access$2	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor;Z)V
    //   167: return
    // Line number table:
    //   Java source line #113	-> byte code offset #0
    //   Java source line #115	-> byte code offset #11
    //   Java source line #116	-> byte code offset #18
    //   Java source line #117	-> byte code offset #26
    //   Java source line #118	-> byte code offset #44
    //   Java source line #119	-> byte code offset #62
    //   Java source line #121	-> byte code offset #75
    //   Java source line #122	-> byte code offset #85
    //   Java source line #123	-> byte code offset #93
    //   Java source line #124	-> byte code offset #111
    //   Java source line #125	-> byte code offset #129
    //   Java source line #128	-> byte code offset #142
    //   Java source line #129	-> byte code offset #143
    //   Java source line #130	-> byte code offset #154
    //   Java source line #129	-> byte code offset #156
    //   Java source line #131	-> byte code offset #167
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	168	0	this	1
    //   0	168	1	event	org.eclipse.mylyn.commons.ui.dialogs.InPlaceDialogEvent
    //   25	31	2	newValues	java.util.Set<String>
    //   92	31	2	newValues	java.util.Set<String>
    //   142	13	3	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   11	142	142	finally
  }
}

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

import org.eclipse.swt.browser.Browser;

class BrowserPreviewViewer$2$1
  implements Runnable
{
  BrowserPreviewViewer$2$1(BrowserPreviewViewer.2 param2, Browser paramBrowser, BrowserPreviewViewer.1PreviewWikiJob param1PreviewWikiJob) {}
  
  public void run()
  {
    BrowserPreviewViewer.access$3(BrowserPreviewViewer.2.access$0(this$1), val$browser, val$job.getHtmlText());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.editors.BrowserPreviewViewer.2.1
 * 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.MouseEvent;
import org.eclipse.swt.events.MouseTrackAdapter;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.forms.widgets.ImageHyperlink;

class PersonAttributeEditor$2
  extends MouseTrackAdapter
{
  int version = 0;
  
  PersonAttributeEditor$2(PersonAttributeEditor paramPersonAttributeEditor, ImageHyperlink paramImageHyperlink, Composite paramComposite) {}
  
  public void mouseEnter(MouseEvent e)
  {
    val$selfLink.getLayoutData()).exclude = false;
    val$composite.layout();
    val$selfLink.redraw();
    version += 1;
  }
  
  public void mouseExit(MouseEvent e)
  {
    final int lastVersion = version;
    Display.getDefault().asyncExec(new Runnable()
    {
      public void run()
      {
        if ((version != lastVersion) || (val$selfLink.isDisposed())) {
          return;
        }
        val$selfLink.redraw();
        val$selfLink.getLayoutData()).exclude = true;
        val$composite.layout();
      }
    });
  }
}

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

import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.TaskActivationAdapter;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

class PlanningPart$2
  extends TaskActivationAdapter
{
  PlanningPart$2(PlanningPart paramPlanningPart) {}
  
  public void taskActivated(ITask task)
  {
    if (task.equals(this$0.getTask())) {
      PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
      {
        public void run()
        {
          if ((PlanningPart.access$0(this$0) != null) && (!PlanningPart.access$0(this$0).isDisposed())) {
            PlanningPart.access$1(this$0);
          }
        }
      });
    }
  }
  
  public void taskDeactivated(ITask task)
  {
    if (task.equals(this$0.getTask())) {
      PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
      {
        public void run()
        {
          if ((PlanningPart.access$0(this$0) != null) && (!PlanningPart.access$0(this$0).isDisposed())) {
            PlanningPart.access$1(this$0);
          }
        }
      });
    }
  }
}

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

import org.eclipse.mylyn.tasks.core.ITaskComment;
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;

class TaskEditorCommentPart$1
  extends CommentGroupStrategy
{
  TaskEditorCommentPart$1(TaskEditorCommentPart paramTaskEditorCommentPart) {}
  
  protected boolean hasIncomingChanges(ITaskComment taskComment)
  {
    return this$0.getModel().hasIncomingChanges(taskComment.getTaskAttribute());
  }
}

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

import java.util.Arrays;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.Assert;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
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.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.FormToolkit;

public class MultiSelectionAttributeEditor
  extends AbstractAttributeEditor
{
  private String[] allValues;
  private Text text;
  private org.eclipse.swt.widgets.List list;
  protected boolean suppressRefresh;
  
  public MultiSelectionAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute)
  {
    super(manager, taskAttribute);
    if (isReadOnly()) {
      setLayoutHint(new LayoutHint(Layou
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