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

: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.tasks.ui.dialogs;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.IWorkingSetEditWizard;
import org.eclipse.ui.dialogs.IWorkingSetNewWizard;
import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog;
import org.eclipse.ui.dialogs.SelectionDialog;
import org.eclipse.ui.help.IWorkbenchHelpSystem;
import org.eclipse.ui.internal.WorkbenchMessages;
import org.eclipse.ui.internal.WorkbenchPlugin;
import org.eclipse.ui.internal.WorkingSet;
import org.eclipse.ui.internal.registry.WorkingSetRegistry;

public abstract class AbstractWorkingSetDialogCOPY
  extends SelectionDialog
  implements IWorkingSetSelectionDialog
{
  private static final int ID_NEW = 1025;
  private static final int ID_DETAILS = 1026;
  private static final int ID_REMOVE = 1027;
  private static final int ID_SELECTALL = 1028;
  private static final int ID_DESELECTALL = 1029;
  private Button newButton;
  private Button detailsButton;
  private Button removeButton;
  private Button selectAllButton;
  private Button deselectAllButton;
  private IWorkingSet[] result;
  private List addedWorkingSets;
  private List removedWorkingSets;
  private Map editedWorkingSets;
  private List removedMRUWorkingSets;
  private Set workingSetIds;
  private final boolean canEdit;
  
  protected AbstractWorkingSetDialogCOPY(Shell parentShell, String[] workingSetIds, boolean canEdit)
  {
    super(parentShell);
    if (workingSetIds != null)
    {
      this.workingSetIds = new HashSet();
      String[] arrayOfString;
      int j = (arrayOfString = workingSetIds).length;
      for (int i = 0; i < j; i++)
      {
        String workingSetId = arrayOfString[i];
        this.workingSetIds.add(workingSetId);
      }
    }
    this.canEdit = canEdit;
  }
  
  protected Set getSupportedWorkingSetIds()
  {
    return workingSetIds;
  }
  
  protected void addModifyButtons(Composite composite)
  {
    Composite buttonComposite = new Composite(composite, 131072);
    GridLayout layout = new GridLayout();
    marginHeight = (marginWidth = 0);
    verticalSpacing = convertVerticalDLUsToPixels(4);
    buttonComposite.setLayout(layout);
    GridData data = new GridData(1026);
    buttonComposite.setLayoutData(data);
    
    newButton = createButton(buttonComposite, 1025, WorkbenchMessages.WorkingSetSelectionDialog_newButton_label, 
      false);
    newButton.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent e)
      {
        createWorkingSet();
      }
    });
    if (canEdit)
    {
      detailsButton = createButton(buttonComposite, 1026, 
        WorkbenchMessages.WorkingSetSelectionDialog_detailsButton_label, false);
      detailsButton.setEnabled(false);
      detailsButton.addSelectionListener(new SelectionAdapter()
      {
        public void widgetSelected(SelectionEvent e)
        {
          editSelectedWorkingSet();
        }
      });
      removeButton = createButton(buttonComposite, 1027, 
        WorkbenchMessages.WorkingSetSelectionDialog_removeButton_label, false);
      removeButton.setEnabled(false);
      removeButton.addSelectionListener(new SelectionAdapter()
      {
        public void widgetSelected(SelectionEvent e)
        {
          removeSelectedWorkingSets();
        }
      });
    }
    numColumns = 1;
  }
  
  protected void addSelectionButtons(Composite composite)
  {
    Composite buttonComposite = new Composite(composite, 0);
    GridLayout layout = new GridLayout(2, false);
    marginHeight = (marginWidth = 0);
    horizontalSpacing = convertHorizontalDLUsToPixels(4);
    buttonComposite.setLayout(layout);
    GridData data = new GridData(32);
    buttonComposite.setLayoutData(data);
    
    selectAllButton = createButton(buttonComposite, 1028, WorkbenchMessages.SelectionDialog_selectLabel, 
      false);
    selectAllButton.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent e)
      {
        selectAllSets();
      }
    });
    deselectAllButton = createButton(buttonComposite, 1029, 
      WorkbenchMessages.SelectionDialog_deselectLabel, false);
    deselectAllButton.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent e)
      {
        deselectAllSets();
      }
    });
  }
  
  protected abstract void selectAllSets();
  
  protected abstract void deselectAllSets();
  
  void editSelectedWorkingSet()
  {
    IWorkingSetManager manager = WorkbenchPlugin.getDefault().getWorkingSetManager();
    IWorkingSet editWorkingSet = (IWorkingSet)getSelectedWorkingSets().get(0);
    IWorkingSetEditWizard wizard = manager.createWorkingSetEditWizard(editWorkingSet);
    WizardDialog dialog = new WizardDialog(getShell(), wizard);
    IWorkingSet originalWorkingSet = (IWorkingSet)editedWorkingSets.get(editWorkingSet);
    boolean firstEdit = originalWorkingSet == null;
    if (firstEdit) {
      originalWorkingSet = new WorkingSet(editWorkingSet.getName(), editWorkingSet.getLabel(), 
        editWorkingSet.getElements());
    } else {
      editedWorkingSets.remove(editWorkingSet);
    }
    dialog.create();
    PlatformUI.getWorkbench()
      .getHelpSystem()
      .setHelp(dialog.getShell(), "org.eclipse.ui.working_set_edit_wizard_context");
    if (dialog.open() == 0)
    {
      editWorkingSet = wizard.getSelection();
      availableWorkingSetsChanged();
      
      updateButtonAvailability();
    }
    editedWorkingSets.put(editWorkingSet, originalWorkingSet);
  }
  
  void createWorkingSet()
  {
    IWorkingSetManager manager = WorkbenchPlugin.getDefault().getWorkingSetManager();
    String[] ids = null;
    if (workingSetIds != null) {
      ids = (String[])workingSetIds.toArray(new String[workingSetIds.size()]);
    }
    IWorkingSetNewWizard wizard = manager.createWorkingSetNewWizard(ids);
    
    WizardDialog dialog = new WizardDialog(getShell(), wizard);
    
    dialog.create();
    PlatformUI.getWorkbench()
      .getHelpSystem()
      .setHelp(dialog.getShell(), "org.eclipse.ui.working_set_new_wizard_context");
    if (dialog.open() == 0)
    {
      IWorkingSet workingSet = wizard.getSelection();
      manager.addWorkingSet(workingSet);
      addedWorkingSets.add(workingSet);
      availableWorkingSetsChanged();
    }
  }
  
  protected abstract List getSelectedWorkingSets();
  
  protected void availableWorkingSetsChanged()
  {
    boolean enable = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSets().length > 0;
    if ((selectAllButton != null) && (!selectAllButton.isDisposed())) {
      selectAllButton.setEnabled(enable);
    }
    if ((deselectAllButton != null) && (!deselectAllButton.isDisposed())) {
      deselectAllButton.setEnabled(enable);
    }
  }
  
  public IWorkingSet[] getSelection()
  {
    return result;
  }
  
  public void setSelection(IWorkingSet[] selection)
  {
    result = selection;
  }
  
  public int open()
  {
    addedWorkingSets = new ArrayList();
    removedWorkingSets = new ArrayList();
    editedWorkingSets = new HashMap();
    removedMRUWorkingSets = new ArrayList();
    return super.open();
  }
  
  protected final List getAddedWorkingSets()
  {
    return addedWorkingSets;
  }
  
  protected final Map getEditedWorkingSets()
  {
    return editedWorkingSets;
  }
  
  protected final List getRemovedMRUWorkingSets()
  {
    return removedMRUWorkingSets;
  }
  
  protected final List getRemovedWorkingSets()
  {
    return removedWorkingSets;
  }
  
  protected void updateButtonAvailability()
  {
    List selection = getSelectedWorkingSets();
    boolean hasSelection = (selection != null) && (!selection.isEmpty());
    boolean hasSingleSelection = hasSelection;
    WorkingSetRegistry registry = WorkbenchPlugin.getDefault().getWorkingSetRegistry();
    
    newButton.setEnabled(registry.hasNewPageWorkingSetDescriptor());
    if (canEdit) {
      removeButton.setEnabled(hasSelection);
    }
    IWorkingSet selectedWorkingSet = null;
    if (hasSelection)
    {
      hasSingleSelection = selection.size() == 1;
      if (hasSingleSelection) {
        selectedWorkingSet = (IWorkingSet)selection.get(0);
      }
    }
    if (canEdit) {
      detailsButton.setEnabled((hasSingleSelection) && (selectedWorkingSet.isEditable()));
    }
    getOkButton().setEnabled(true);
  }
  
  protected void removeSelectedWorkingSets()
  {
    List selection = getSelectedWorkingSets();
    removeSelectedWorkingSets(selection);
  }
  
  protected void removeSelectedWorkingSets(List selection)
  {
    IWorkingSetManager manager = WorkbenchPlugin.getDefault().getWorkingSetManager();
    Iterator iter = selection.iterator();
    while (iter.hasNext())
    {
      IWorkingSet workingSet = (IWorkingSet)iter.next();
      if (getAddedWorkingSets().contains(workingSet))
      {
        getAddedWorkingSets().remove(workingSet);
      }
      else
      {
        IWorkingSet[] recentWorkingSets = manager.getRecentWorkingSets();
        IWorkingSet[] arrayOfIWorkingSet1;
        int j = (arrayOfIWorkingSet1 = recentWorkingSets).length;
        for (int i = 0; i < j; i++)
        {
          IWorkingSet recentWorkingSet = arrayOfIWorkingSet1[i];
          if (workingSet.equals(recentWorkingSet))
          {
            getRemovedMRUWorkingSets().add(workingSet);
            break;
          }
        }
        getRemovedWorkingSets().add(workingSet);
      }
      manager.removeWorkingSet(workingSet);
    }
    availableWorkingSetsChanged();
  }
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class TaskCompareDialog$2
  extends SelectionAdapter
{
  TaskCompareDialog$2(TaskCompareDialog paramTaskCompareDialog) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    this$0.markDirty();
  }
}

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

import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class TaskRepositoryCredentialsDialog$1
  extends SelectionAdapter
{
  TaskRepositoryCredentialsDialog$1(TaskRepositoryCredentialsDialog paramTaskRepositoryCredentialsDialog) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    this$0.close();
    int returnCode = TasksUiUtil.openEditRepositoryWizard(TaskRepositoryCredentialsDialog.access$0(this$0));
    if (returnCode == 0) {
      TaskRepositoryCredentialsDialog.access$1(this$0, 1000);
    } else {
      TaskRepositoryCredentialsDialog.access$1(this$0, returnCode);
    }
  }
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class AbstractWorkingSetDialogCOPY$5
  extends SelectionAdapter
{
  AbstractWorkingSetDialogCOPY$5(AbstractWorkingSetDialogCOPY paramAbstractWorkingSetDialogCOPY) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    this$0.deselectAllSets();
  }
}

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

import java.util.Comparator;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;

class UiLegendControl$4
  implements Comparator<AbstractRepositoryConnector>
{
  UiLegendControl$4(UiLegendControl paramUiLegendControl) {}
  
  public int compare(AbstractRepositoryConnector o1, AbstractRepositoryConnector o2)
  {
    return o1.getLabel().compareToIgnoreCase(o2.getLabel());
  }
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class TaskCompareDialog$3
  extends SelectionAdapter
{
  TaskCompareDialog$3(TaskCompareDialog paramTaskCompareDialog) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    this$0.markDirty();
  }
}

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

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.widgets.Text;

class TaskRepositoryCredentialsDialog$2
  implements ModifyListener
{
  TaskRepositoryCredentialsDialog$2(TaskRepositoryCredentialsDialog paramTaskRepositoryCredentialsDialog, Text paramText) {}
  
  public void modifyText(ModifyEvent e)
  {
    TaskRepositoryCredentialsDialog.access$2(this$0, val$usernameField.getText());
  }
}

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

import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.events.IHyperlinkListener;

class UiLegendControl$5
  implements IHyperlinkListener
{
  UiLegendControl$5(UiLegendControl paramUiLegendControl) {}
  
  public void linkActivated(HyperlinkEvent e)
  {
    this$0.close();
    TasksUiUtil.openUrl(Messages.UiLegendControl_http_www_eclipse_org_mylyn_start);
  }
  
  public void linkEntered(HyperlinkEvent e) {}
  
  public void linkExited(HyperlinkEvent e) {}
}

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

import java.util.ArrayList;
import java.util.Arrays;
import org.eclipse.mylyn.internal.tasks.ui.util.SortCriterion;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;

class TaskCompareDialog$4
  extends SelectionAdapter
{
  TaskCompareDialog$4(TaskCompareDialog paramTaskCompareDialog, int paramInt) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    ArrayList<String> oldSelectionList = new ArrayList(
      Arrays.asList(TaskCompareDialog.access$1(this$0)[val$index].getItems()));
    String oldSelection;
    String oldSelection;
    if (val$index + 1 == SortCriterion.kindCount)
    {
      oldSelection = TaskCompareDialog.access$2(this$0);
    }
    else
    {
      oldSelectionList.removeAll(Arrays.asList(TaskCompareDialog.access$1(this$0)[(val$index + 1)].getItems()));
      oldSelection = TaskCompareDialog.access$0(this$0)[org.eclipse.mylyn.internal.tasks.ui.util.SortCriterion.SortKey.NONE.ordinal()];
      if (oldSelectionList.size() == 1) {
        oldSelection = (String)oldSelectionList.get(0);
      }
    }
    String newSelection = TaskCompareDialog.access$1(this$0)[val$index].getItem(TaskCompareDialog.access$1(this$0)[val$index].getSelectionIndex());
    if (oldSelection.equals(newSelection)) {
      return;
    }
    if (val$index + 1 == SortCriterion.kindCount) {
      TaskCompareDialog.access$3(this$0, newSelection);
    }
    if (oldSelection.equals(TaskCompareDialog.access$0(this$0)[org.eclipse.mylyn.internal.tasks.ui.util.SortCriterion.SortKey.NONE.ordinal()]))
    {
      TaskCompareDialog.access$4(this$0)[val$index].setEnabled(true);
      TaskCompareDialog.access$5(this$0)[val$index].setEnabled(true);
      if (val$index + 1 < SortCriterion.kindCount)
      {
        TaskCompareDialog.access$1(this$0)[(val$index + 1)].setEnabled(true);
        ArrayList<String> availablePriorities = new ArrayList(
          Arrays.asList(TaskCompareDialog.access$1(this$0)[val$index].getItems()));
        availablePriorities.remove(newSelection);
        for (int k = val$index + 1; k < SortCriterion.kindCount; k++)
        {
          TaskCompareDialog.access$1(this$0)[k].removeAll();
          for (int j = 0; j < availablePriorities.size(); j++) {
            TaskCompareDialog.access$1(this$0)[k].add((String)availablePriorities.get(j));
          }
          TaskCompareDialog.access$1(this$0)[k].select(TaskCompareDialog.access$1(this$0)[k].indexOf(TaskCompareDialog.access$0(this$0)[org.eclipse.mylyn.internal.tasks.ui.util.SortCriterion.SortKey.NONE.ordinal()]));
        }
      }
    }
    else if (newSelection.equals(TaskCompareDialog.access$0(this$0)[org.eclipse.mylyn.internal.tasks.ui.util.SortCriterion.SortKey.NONE.ordinal()]))
    {
      TaskCompareDialog.access$4(this$0)[val$index].setEnabled(false);
      TaskCompareDialog.access$5(this$0)[val$index].setEnabled(false);
      if (val$index + 1 < SortCriterion.kindCount)
      {
        ArrayList<String> availablePriorities = new ArrayList(
          Arrays.asList(TaskCompareDialog.access$1(this$0)[val$index].getItems()));
        for (int k = val$index + 1; k < SortCriterion.kindCount; k++)
        {
          TaskCompareDialog.access$1(this$0)[k].setEnabled(true);
          TaskCompareDialog.access$1(this$0)[k].removeAll();
          for (int j = 0; j < availablePriorities.size(); j++) {
            TaskCompareDialog.access$1(this$0)[k].add((String)availablePriorities.get(j));
          }
          TaskCompareDialog.access$1(this$0)[k].select(TaskCompareDialog.access$1(this$0)[k].indexOf(TaskCompareDialog.access$0(this$0)[org.eclipse.mylyn.internal.tasks.ui.util.SortCriterion.SortKey.NONE.ordinal()]));
          TaskCompareDialog.access$1(this$0)[k].setEnabled(false);
          TaskCompareDialog.access$4(this$0)[k].setEnabled(false);
          TaskCompareDialog.access$5(this$0)[k].setEnabled(false);
        }
      }
    }
    else
    {
      for (int j = val$index + 1; j < TaskCompareDialog.access$1(this$0).length; j++)
      {
        int newSelectionIndex = TaskCompareDialog.access$1(this$0)[j].indexOf(newSelection);
        if (TaskCompareDialog.access$1(this$0)[j].getSelectionIndex() == newSelectionIndex)
        {
          TaskCompareDialog.access$1(this$0)[j].remove(newSelection);
          int insertionPoint = -1 - 
            Arrays.binarySearch(TaskCompareDialog.access$1(this$0)[j].getItems(), oldSelection, 
            TaskCompareDialog.access$6(this$0));
          if ((insertionPoint >= 0) && (insertionPoint <= TaskCompareDialog.access$1(this$0)[j].getItemCount())) {
            TaskCompareDialog.access$1(this$0)[j].add(oldSelection, insertionPoint);
          } else {
            TaskCompareDialog.access$1(this$0)[j].add(oldSelection);
          }
          TaskCompareDialog.access$1(this$0)[j].select(TaskCompareDialog.access$1(this$0)[j].indexOf(oldSelection));
        }
        else if (newSelectionIndex >= 0)
        {
          String currentText = TaskCompareDialog.access$1(this$0)[j].getText();
          TaskCompareDialog.access$1(this$0)[j].remove(newSelection);
          int insertionPoint = -1 - 
            Arrays.binarySearch(TaskCompareDialog.access$1(this$0)[j].getItems(), oldSelection, 
            TaskCompareDialog.access$6(this$0));
          if ((insertionPoint >= 0) && (insertionPoint <= TaskCompareDialog.access$1(this$0)[j].getItemCount()))
          {
            TaskCompareDialog.access$1(this$0)[j].add(oldSelection, insertionPoint);
            TaskCompareDialog.access$1(this$0)[j].select(TaskCompareDialog.access$1(this$0)[j].indexOf(currentText));
          }
          else
          {
            TaskCompareDialog.access$1(this$0)[j].add(oldSelection);
          }
        }
      }
    }
    this$0.markDirty();
  }
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class TaskListSortDialog$1
  extends SelectionAdapter
{
  TaskListSortDialog$1(TaskListSortDialog paramTaskListSortDialog) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    this$0.markDirty();
  }
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Text;

class TaskRepositoryCredentialsDialog$3
  extends SelectionAdapter
{
  TaskRepositoryCredentialsDialog$3(TaskRepositoryCredentialsDialog paramTaskRepositoryCredentialsDialog, Text paramText) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    FileDialog fileDialog = new FileDialog(this$0.getShell(), 4096);
    fileDialog.setFilterPath(System.getProperty("user.home", "."));
    String returnFile = fileDialog.open();
    if (returnFile != null)
    {
      TaskRepositoryCredentialsDialog.access$2(this$0, returnFile);
      val$usernameField.setText(returnFile);
    }
  }
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class TaskCompareDialog$5
  extends SelectionAdapter
{
  TaskCompareDialog$5(TaskCompareDialog paramTaskCompareDialog) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    this$0.markDirty();
  }
}

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

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.window.Window;
import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.mylyn.commons.ui.compatibility.CommonFonts;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
import org.eclipse.mylyn.tasks.ui.LegendElement;
import org.eclipse.mylyn.tasks.ui.TaskElementLabelProvider;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Hyperlink;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.forms.widgets.TableWrapData;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
import org.eclipse.ui.themes.ITheme;
import org.eclipse.ui.themes.IThemeManager;

public class UiLegendControl
  extends Composite
{
  private final FormToolkit toolkit;
  private Window window = null;
  private final TaskElementLabelProvider labelProvider = new TaskElementLabelProvider(false);
  private final IThemeManager themeManager = PlatformUI.getWorkbench().getThemeManager();
  private final ArrayList<LegendElement> legendElements = new ArrayList();
  
  public UiLegendControl(Composite parent, FormToolkit toolkit)
  {
    this(parent, toolkit, true, 512);
  }
  
  public UiLegendControl(Composite parent, FormToolkit toolkit, boolean showConnectors, int style)
  {
    super(parent, 0);
    this.toolkit = toolkit;
    toolkit.adapt(this);
    
    addDisposeListener(new DisposeListener()
    {
      public void widgetDisposed(DisposeEvent e)
      {
        UiLegendControl.this.doDispose();
      }
    });
    TableWrapLayout layout = new TableWrapLayout();
    leftMargin = 0;
    rightMargin = 0;
    topMargin = 0;
    bottomMargin = 0;
    if (style == -1) {
      createContentsVertical(layout, showConnectors);
    } else if ((style & 0x100) != 0) {
      createContentsHorizontal(layout, showConnectors);
    } else {
      createContentsVertical(layout, showConnectors);
    }
    setLayout(layout);
    setLayoutData(new TableWrapData(256, 256));
  }
  
  private void doDispose()
  {
    for (LegendElement element : legendElements) {
      element.dispose();
    }
    if (labelProvider != null) {
      labelProvider.dispose();
    }
  }
  
  public void setWindow(Window window)
  {
    this.window = window;
  }
  
  public boolean close()
  {
    if (window != null) {
      return window.close();
    }
    return false;
  }
  
  private void createContentsHorizontal(TableWrapLayout layout, boolean showConnectors)
  {
    numColumns = 2;
    createTasksPrioritiesSection(this);
    createContextSection(this);
    createActivitySection(this);
    createSynchronizationSection(this);
    
    Composite subComp = toolkit.createComposite(this);
    TableWrapLayout subLayout = new TableWrapLayout();
    topMargin = 0;
    bottomMargin = 0;
    leftMargin = 0;
    rightMargin = 0;
    subComp.setLayout(subLayout);
    subComp.setLayoutData(new TableWrapData(256, 256, 1, 2));
    if (showConnectors) {
      createConnectorsSection(subComp);
    }
    createGettingStartedSection(subComp);
  }
  
  private void createContentsVertical(TableWrapLayout layout, boolean showConnectors)
  {
    numColumns = 1;
    createTasksPrioritiesSection(this);
    createActivitySection(this);
    createContextSection(this);
    createSynchronizationSection(this);
    if (showConnectors) {
      createConnectorsSection(this);
    }
    createGettingStartedSection(this);
  }
  
  private void createTasksPrioritiesSection(Composite parent)
  {
    TableWrapLayout layout = new TableWrapLayout();
    numColumns = 2;
    makeColumnsEqualWidth = true;
    leftMargin = 0;
    rightMargin = 0;
    topMargin = 0;
    bottomMargin = 0;
    
    Composite composite = toolkit.createComposite(parent);
    composite.setLayout(layout);
    composite.setLayoutData(new TableWrapData(256));
    
    createTasksSection(composite);
    createPrioritiesSection(composite);
  }
  
  private void createTasksSection(Composite parent)
  {
    Section tasksSection = toolkit.createSection(parent, 256);
    tasksSection.setText(Messages.UiLegendControl_Tasks);
    tasksSection.setLayout(new TableWrapLayout());
    tasksSection.setLayoutData(new TableWrapData(256));
    
    TableWrapLayout layout = new TableWrapLayout();
    numColumns = 2;
    makeColumnsEqualWidth = false;
    verticalSpacing = 1;
    topMargin = 1;
    bottomMargin = 1;
    
    Composite tasksClient = toolkit.createComposite(tasksSection);
    tasksClient.setLayout(layout);
    tasksClient.setLayoutData(new TableWrapData(256));
    tasksSection.setClient(tasksClient);
    
    Label imageLabel = toolkit.createLabel(tasksClient, "");
    imageLabel.setImage(CommonImages.getImage(TasksUiImages.TASK));
    toolkit.createLabel(tasksClient, Messages.UiLegendControl_Task);
    
    imageLabel = toolkit.createLabel(tasksClient, "");
    imageLabel.setImage(CommonImages.getImage(TasksUiImages.CATEGORY));
    toolkit.createLabel(tasksClient, Messages.UiLegendControl_Category);
    
    imageLabel = toolkit.createLabel(tasksClient, "");
    imageLabel.setImage(CommonImages.getImage(TasksUiImages.QUERY));
    toolkit.createLabel(tasksClient, Messages.UiLegendControl_Query);
    
    imageLabel = toolkit.createLabel(tasksClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.CALENDAR));
    toolkit.createLabel(tasksClient, Messages.UiLegendControl_Date_range);
    
    imageLabel = toolkit.createLabel(tasksClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.BLANK));
    
    Hyperlink openView = toolkit.createHyperlink(tasksClient, Messages.UiLegendControl_Open_Task_List_, 64);
    openView.addHyperlinkListener(new IHyperlinkListener()
    {
      public void linkActivated(HyperlinkEvent e)
      {
        close();
        TasksUiUtil.openTasksViewInActivePerspective();
      }
      
      public void linkEntered(HyperlinkEvent e) {}
      
      public void linkExited(HyperlinkEvent e) {}
    });
  }
  
  private void createPrioritiesSection(Composite parent)
  {
    Section prioritiesSection = toolkit.createSection(parent, 256);
    prioritiesSection.setText(Messages.UiLegendControl_Priorities);
    prioritiesSection.setLayout(new TableWrapLayout());
    prioritiesSection.setLayoutData(new TableWrapData(256));
    
    TableWrapLayout layout = new TableWrapLayout();
    numColumns = 2;
    makeColumnsEqualWidth = false;
    verticalSpacing = 1;
    topMargin = 1;
    bottomMargin = 1;
    
    Composite prioritiesClient = toolkit.createComposite(prioritiesSection);
    prioritiesClient.setLayout(layout);
    prioritiesClient.setLayoutData(new TableWrapData(256));
    prioritiesSection.setClient(prioritiesClient);
    
    Label imageLabel = toolkit.createLabel(prioritiesClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.PRIORITY_1));
    toolkit.createLabel(prioritiesClient, ITask.PriorityLevel.P1.getDescription());
    
    imageLabel = toolkit.createLabel(prioritiesClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.PRIORITY_2));
    toolkit.createLabel(prioritiesClient, ITask.PriorityLevel.P2.getDescription());
    
    imageLabel = toolkit.createLabel(prioritiesClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.PRIORITY_3));
    toolkit.createLabel(prioritiesClient, ITask.PriorityLevel.P3.getDescription() + Messages.UiLegendControl__default_);
    
    imageLabel = toolkit.createLabel(prioritiesClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.PRIORITY_4));
    toolkit.createLabel(prioritiesClient, ITask.PriorityLevel.P4.getDescription());
    
    imageLabel = toolkit.createLabel(prioritiesClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.PRIORITY_5));
    toolkit.createLabel(prioritiesClient, ITask.PriorityLevel.P5.getDescription());
  }
  
  private void createActivitySection(Composite parent)
  {
    Section activitySection = toolkit.createSection(parent, 256);
    activitySection.setText(Messages.UiLegendControl_Task_Activity);
    activitySection.setLayout(new TableWrapLayout());
    activitySection.setLayoutData(new TableWrapData(256));
    
    TableWrapLayout layout = new TableWrapLayout();
    numColumns = 2;
    makeColumnsEqualWidth = false;
    verticalSpacing = 1;
    topMargin = 1;
    bottomMargin = 1;
    
    Composite activityClient = toolkit.createComposite(activitySection);
    activityClient.setLayout(layout);
    activityClient.setLayoutData(new TableWrapData(256));
    activitySection.setClient(activityClient);
    
    Label imageLabel = toolkit.createLabel(activityClient, "");
    imageLabel.setImage(CommonImages.getImage(TasksUiImages.TASK));
    Label labelToday = toolkit.createLabel(activityClient, Messages.UiLegendControl_Scheduled_for_today);
    labelToday.setForeground(themeManager.getCurrentTheme()
      .getColorRegistry()
      .get("org.eclipse.mylyn.tasks.ui.colors.foreground.today.scheduled"));
    
    imageLabel = toolkit.createLabel(activityClient, "");
    imageLabel.setImage(CommonImages.getImage(TasksUiImages.TASK));
    Label labelOverdue = toolkit.createLabel(activityClient, Messages.UiLegendControl_Past_scheduled_date);
    labelOverdue.setForeground(themeManager.getCurrentTheme()
      .getColorRegistry()
      .get("org.eclipse.mylyn.tasks.ui.colors.foreground.past.scheduled"));
    
    imageLabel = toolkit.createLabel(activityClient, "");
    imageLabel.setImage(CommonImages.getImage(TasksUiImages.TASK));
    Label labelCompleted = toolkit.createLabel(activityClient, Messages.UiLegendControl_Completed);
    labelCompleted.setFont(CommonFonts.STRIKETHROUGH);
    
    labelCompleted.setForeground(themeManager.getCurrentTheme()
      .getColorRegistry()
      .get("org.eclipse.mylyn.tasks.ui.colors.foreground.completed"));
    
    imageLabel = toolkit.createLabel(activityClient, "");
    imageLabel.setImage(CommonImages.getImage(TasksUiImages.TASK));
    Label labelCompletedToday = toolkit.createLabel(activityClient, Messages.UiLegendControl_Completed_today);
    labelCompletedToday.setFont(CommonFonts.STRIKETHROUGH);
    labelCompletedToday.setForeground(themeManager.getCurrentTheme()
      .getColorRegistry()
      .get("org.eclipse.mylyn.tasks.ui.colors.foreground.today.completed"));
    
    imageLabel = toolkit.createLabel(activityClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.OVERLAY_DATE_DUE));
    toolkit.createLabel(activityClient, Messages.UiLegendControl_Has_due_date);
    
    imageLabel = toolkit.createLabel(activityClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.OVERLAY_DATE_OVERDUE));
    Label textLabel = toolkit.createLabel(activityClient, Messages.UiLegendControl_Past_Due_date);
    textLabel.setForeground(themeManager.getCurrentTheme().getColorRegistry().get("org.eclipse.mylyn.tasks.ui.colors.foreground.past.due"));
    
    imageLabel = toolkit.createLabel(activityClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.BLANK));
    Hyperlink adjust = toolkit.createHyperlink(activityClient, Messages.UiLegendControl_Adjust_Colors_and_Fonts_, 
      64);
    adjust.addHyperlinkListener(new IHyperlinkListener()
    {
      public void linkActivated(HyperlinkEvent e)
      {
        PreferenceDialog dlg = PreferencesUtil.createPreferenceDialogOn(PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow()
          .getShell(), "org.eclipse.ui.preferencePages.ColorsAndFonts", 
          new String[] { "org.eclipse.ui.preferencePages.ColorsAndFonts" }, null);
        dlg.open();
      }
      
      public void linkEntered(HyperlinkEvent e) {}
      
      public void linkExited(HyperlinkEvent e) {}
    });
  }
  
  private void createContextSection(Composite parent)
  {
    Section contextSection = toolkit.createSection(parent, 256);
    contextSection.setText(Messages.UiLegendControl_Task_Context);
    contextSection.setLayout(new TableWrapLayout());
    contextSection.setLayoutData(new TableWrapData(256));
    
    TableWrapLayout layout = new TableWrapLayout();
    numColumns = 2;
    makeColumnsEqualWidth = false;
    verticalSpacing = 1;
    topMargin = 1;
    bottomMargin = 1;
    
    Composite contextClient = toolkit.createComposite(contextSection);
    contextClient.setLayout(layout);
    contextClient.setLayoutData(new TableWrapData(256));
    contextSection.setClient(contextClient);
    
    Label imageLabel = toolkit.createLabel(contextClient, "");
    imageLabel.setImage(CommonImages.getImage(TasksUiImages.CONTEXT_FOCUS));
    toolkit.createLabel(contextClient, Messages.UiLegendControl_Focus_view_on_active_task);
    
    imageLabel = toolkit.createLabel(contextClient, "");
    imageLabel.setImage(CommonImages.getImage(TasksUiImages.CONTEXT_INACTIVE_EMPTY));
    toolkit.createLabel(contextClient, Messages.UiLegendControl_Inactive_task_with_no_context);
    
    imageLabel = toolkit.createLabel(contextClient, "");
    imageLabel.setImage(CommonImages.getImage(TasksUiImages.CONTEXT_INACTIVE));
    toolkit.createLabel(contextClient, Messages.UiLegendControl_Inactive_task_with_context);
    
    imageLabel = toolkit.createLabel(contextClient, "");
    imageLabel.setImage(CommonImages.getImage(TasksUiImages.CONTEXT_ACTIVE));
    toolkit.createLabel(contextClient, Messages.UiLegendControl_Active_task);
  }
  
  private void createSynchronizationSection(Composite parent)
  {
    Section synchroSection = toolkit.createSection(parent, 256);
    synchroSection.setText(Messages.UiLegendControl_Synchronization);
    synchroSection.setLayout(new TableWrapLayout());
    synchroSection.setLayoutData(new TableWrapData(256));
    
    TableWrapLayout layout = new TableWrapLayout();
    numColumns = 2;
    makeColumnsEqualWidth = false;
    verticalSpacing = 3;
    topMargin = 1;
    bottomMargin = 1;
    
    Composite synchroClient = toolkit.createComposite(synchroSection);
    synchroClient.setLayout(layout);
    synchroClient.setLayoutData(new TableWrapData(256));
    synchroSection.setClient(synchroClient);
    
    Label imageLabel = toolkit.createLabel(synchroClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.OVERLAY_SYNC_INCOMMING_NEW));
    toolkit.createLabel(synchroClient, Messages.UiLegendControl_New_task);
    
    imageLabel = toolkit.createLabel(synchroClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.OVERLAY_SYNC_INCOMMING));
    toolkit.createLabel(synchroClient, Messages.UiLegendControl_Incoming_changes);
    
    imageLabel = toolkit.createLabel(synchroClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.OVERLAY_SYNC_OUTGOING));
    toolkit.createLabel(synchroClient, Messages.UiLegendControl_Outgoing_changes);
    
    imageLabel = toolkit.createLabel(synchroClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.OVERLAY_SYNC_OUTGOING_NEW));
    toolkit.createLabel(synchroClient, Messages.UiLegendControl_Unsubmitted_outgoing_changes);
    
    imageLabel = toolkit.createLabel(synchroClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.OVERLAY_SYNC_WARNING));
    toolkit.createLabel(synchroClient, Messages.UiLegendControl_Synchronization_failed);
    
    imageLabel = toolkit.createLabel(synchroClient, "");
    imageLabel.setImage(CommonImages.getImage(CommonImages.OVERLAY_SYNC_CONFLICT));
    toolkit.createLabel(synchroClient, Messages.UiLegendControl_Conflicting_changes);
  }
  
  private void createConnectorsSection(Composite parent)
  {
    TableWrapLayout layout = new TableWrapLayout();
    makeColumnsEqualWidth = true;
    leftMargin = 0;
    rightMargin = 0;
    topMargin = 0;
    bottomMargin = 0;
    
    ScrolledForm composite = toolkit.createScrolledForm(parent)
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