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

activationImageOffset, Event event, Image image)
  {
    Rectangle rect = image.getBounds();
    int offset = Math.max(0, (height - height) / 2);
    gc.drawImage(image, activationImageOffset, y + offset);
  }
  
  private ImageDescriptor getSynchronizationImageDescriptor(Object element, boolean synchViewStyle)
  {
    if ((element instanceof ITask))
    {
      ITask repositoryTask = (ITask)element;
      if (repositoryTask.getSynchronizationState() == ITask.SynchronizationState.INCOMING_NEW)
      {
        if (synchViewStyle) {
          return CommonImages.OVERLAY_SYNC_OLD_INCOMMING_NEW;
        }
        return CommonImages.OVERLAY_SYNC_INCOMMING_NEW;
      }
      if (repositoryTask.getSynchronizationState() == ITask.SynchronizationState.OUTGOING_NEW)
      {
        if (synchViewStyle) {
          return CommonImages.OVERLAY_SYNC_OLD_OUTGOING;
        }
        return CommonImages.OVERLAY_SYNC_OUTGOING_NEW;
      }
      ImageDescriptor imageDescriptor = null;
      if ((repositoryTask.getSynchronizationState() == ITask.SynchronizationState.OUTGOING) || 
        (repositoryTask.getSynchronizationState() == ITask.SynchronizationState.OUTGOING_NEW))
      {
        if (synchViewStyle) {
          imageDescriptor = CommonImages.OVERLAY_SYNC_OLD_OUTGOING;
        } else {
          imageDescriptor = CommonImages.OVERLAY_SYNC_OUTGOING;
        }
      }
      else if (repositoryTask.getSynchronizationState() == ITask.SynchronizationState.INCOMING)
      {
        if (!Boolean.parseBoolean(repositoryTask.getAttribute("task.common.suppress.incoming"))) {
          if (synchViewStyle) {
            imageDescriptor = CommonImages.OVERLAY_SYNC_OLD_INCOMMING;
          } else {
            imageDescriptor = CommonImages.OVERLAY_SYNC_INCOMMING;
          }
        }
      }
      else if (repositoryTask.getSynchronizationState() == ITask.SynchronizationState.CONFLICT) {
        imageDescriptor = CommonImages.OVERLAY_SYNC_CONFLICT;
      }
      if ((imageDescriptor == null) && ((repositoryTask instanceof AbstractTask)) && 
        (((AbstractTask)repositoryTask).getStatus() != null)) {
        return CommonImages.OVERLAY_SYNC_WARNING;
      }
      if (imageDescriptor != null) {
        return imageDescriptor;
      }
    }
    else if ((element instanceof IRepositoryQuery))
    {
      RepositoryQuery query = (RepositoryQuery)element;
      if (query.getStatus() != null) {
        return CommonImages.OVERLAY_SYNC_WARNING;
      }
    }
    return CommonImages.OVERLAY_CLEAR;
  }
  
  public void dispose()
  {
    TasksUiPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(PROPERTY_LISTENER);
  }
  
  public void setUseStrikethroughForCompleted(boolean useStrikethroughForCompleted)
  {
    this.useStrikethroughForCompleted = useStrikethroughForCompleted;
  }
  
  public void setSynchronizationOverlaid(boolean synchronizationOverlaid)
  {
    this.synchronizationOverlaid = synchronizationOverlaid;
  }
  
  public boolean isFocusedMode()
  {
    return focusedMode;
  }
  
  public void setFocusedMode(boolean focusedMode)
  {
    this.focusedMode = focusedMode;
  }
}

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

class TaskRepositoriesView$2$2
  implements Runnable
{
  TaskRepositoriesView$2$2(TaskRepositoriesView.2 param2) {}
  
  public void run()
  {
    TaskRepositoriesView.2.access$0(this$1).refresh();
  }
}

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

import org.eclipse.mylyn.internal.tasks.core.IRepositoryModelListener;

class TaskRepositoriesView$1
  implements IRepositoryModelListener
{
  TaskRepositoriesView$1(TaskRepositoriesView paramTaskRepositoriesView) {}
  
  public void loaded()
  {
    TaskRepositoriesView.access$0(this$0, new Runnable()
    {
      public void run()
      {
        this$0.refresh();
      }
    });
  }
}

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

import org.eclipse.mylyn.internal.tasks.ui.search.SearchUtil;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;

class TaskListSearchHistoryPopupDialog$1
  extends HyperlinkAdapter
{
  TaskListSearchHistoryPopupDialog$1(TaskListSearchHistoryPopupDialog paramTaskListSearchHistoryPopupDialog) {}
  
  public void linkActivated(HyperlinkEvent e)
  {
    SearchUtil.openSearchDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
  }
}

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

import org.eclipse.mylyn.commons.workbench.DelayedRefreshJob;

class TaskListView$2$1
  implements Runnable
{
  TaskListView$2$1(TaskListView.2 param2) {}
  
  public void run()
  {
    TaskListView.access$1(TaskListView.2.access$0(this$1)).refresh();
  }
}

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

import java.text.MessageFormat;
import java.util.Iterator;
import java.util.Set;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.layout.TreeColumnLayout;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.mylyn.commons.ui.SelectionProviderAdapter;
import org.eclipse.mylyn.commons.workbench.AbstractFilteredTree;
import org.eclipse.mylyn.commons.workbench.AdaptiveRefreshPolicy;
import org.eclipse.mylyn.commons.workbench.search.SearchHistoryPopupDialog;
import org.eclipse.mylyn.commons.workbench.search.TextSearchControl;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.ITaskList;
import org.eclipse.mylyn.internal.tasks.core.ITaskListChangeListener;
import org.eclipse.mylyn.internal.tasks.core.TaskActivityManager;
import org.eclipse.mylyn.internal.tasks.core.TaskContainerDelta;
import org.eclipse.mylyn.internal.tasks.ui.TaskHistoryDropDown;
import org.eclipse.mylyn.internal.tasks.ui.TaskScalingHyperlink;
import org.eclipse.mylyn.internal.tasks.ui.TaskWorkingSetFilter;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.actions.ActivateTaskDialogAction;
import org.eclipse.mylyn.internal.tasks.ui.actions.RepositoryElementActionGroup;
import org.eclipse.mylyn.internal.tasks.ui.actions.TaskWorkingSetAction;
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskListChangeAdapter;
import org.eclipse.mylyn.internal.tasks.ui.search.AbstractSearchHandler;
import org.eclipse.mylyn.internal.tasks.ui.search.AbstractSearchHandler.IFilterChangeListener;
import org.eclipse.mylyn.internal.tasks.ui.search.SearchUtil;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.workingsets.TaskWorkingSetUpdater;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskActivityManager;
import org.eclipse.mylyn.tasks.core.TaskActivityAdapter;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.MenuDetectEvent;
import org.eclipse.swt.events.MenuDetectListener;
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.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.ImageHyperlink;

public class TaskListFilteredTree
  extends AbstractFilteredTree
{
  public static final String LABEL_SEARCH = Messages.TaskListFilteredTree_Search_repository_for_key_or_summary_;
  private TaskScalingHyperlink workingSetLink;
  private TaskScalingHyperlink activeTaskLink;
  private WorkweekProgressBar taskProgressBar;
  private int totalTasks;
  private int completeTime;
  private int completeTasks;
  private int incompleteTime;
  private IWorkingSet currentWorkingSet;
  private MenuManager activeTaskMenuManager;
  private TaskListToolTip taskListToolTip;
  private ITaskListChangeListener changeListener;
  private TaskListChangeAdapter taskProgressBarChangeListener;
  private TaskActivityAdapter taskProgressBarActivityListener;
  private IPropertyChangeListener taskProgressBarWorkingSetListener;
  private TaskWorkingSetFilter workingSetFilter;
  private final IWorkbenchWindow window;
  private SelectionProviderAdapter activeTaskSelectionProvider;
  private RepositoryElementActionGroup actionGroup;
  private StructuredSelection activeSelection;
  private final AbstractSearchHandler searchHandler;
  private Composite searchComposite;
  
  public TaskListFilteredTree(Composite parent, int treeStyle, AbstractSearchHandler searchHandler, IWorkbenchWindow window)
  {
    super(parent, treeStyle, searchHandler.createFilter());
    this.searchHandler = searchHandler;
    initSearchComposite();
    hookContextMenu();
    this.window = window;
    indicateActiveTaskWorkingSet();
    addDisposeListener(new DisposeListener()
    {
      public void widgetDisposed(DisposeEvent e)
      {
        if (changeListener != null) {
          TasksUiInternal.getTaskList().removeChangeListener(changeListener);
        }
        if (taskProgressBarChangeListener != null) {
          TasksUiInternal.getTaskList().removeChangeListener(taskProgressBarChangeListener);
        }
        if (taskProgressBarActivityListener != null) {
          TasksUi.getTaskActivityManager().removeActivityListener(taskProgressBarActivityListener);
        }
        if (taskProgressBarWorkingSetListener != null) {
          PlatformUI.getWorkbench().getWorkingSetManager().removePropertyChangeListener(taskProgressBarWorkingSetListener);
        }
        actionGroup.setSelectionProvider(null);
        activeTaskMenuManager.dispose();
        taskListToolTip.dispose();
      }
    });
  }
  
  private void hookContextMenu()
  {
    actionGroup = new RepositoryElementActionGroup();
    
    activeTaskMenuManager = new MenuManager("#PopupMenu");
    activeTaskMenuManager.setRemoveAllWhenShown(true);
    activeTaskMenuManager.addMenuListener(new IMenuListener()
    {
      public void menuAboutToShow(IMenuManager manager)
      {
        actionGroup.fillContextMenu(manager);
      }
    });
  }
  
  protected TreeViewer doCreateTreeViewer(Composite parent, int style)
  {
    Composite container = new Composite(parent, 0);
    GridData gridData = new GridData(4, 4, true, true);
    verticalIndent = 0;
    horizontalIndent = 0;
    container.setLayoutData(gridData);
    container.setLayout(new TreeColumnLayout());
    return super.doCreateTreeViewer(container, style);
  }
  
  protected Composite createProgressComposite(Composite container)
  {
    Composite progressComposite = new Composite(container, 0);
    GridLayout progressLayout = new GridLayout(1, false);
    marginWidth = 4;
    marginHeight = 0;
    marginBottom = 0;
    horizontalSpacing = 0;
    verticalSpacing = 0;
    progressComposite.setLayout(progressLayout);
    progressComposite.setLayoutData(new GridData(4, -1, true, false, 4, 1));
    
    taskProgressBar = new WorkweekProgressBar(progressComposite);
    taskProgressBar.setLayoutData(new GridData(4, 4, true, true));
    updateTaskProgressBar();
    
    taskProgressBarChangeListener = new TaskListChangeAdapter()
    {
      public void containersChanged(Set<TaskContainerDelta> containers)
      {
        for (TaskContainerDelta taskContainerDelta : containers) {
          if ((taskContainerDelta.getElement() instanceof ITask))
          {
            TaskListFilteredTree.this.updateTaskProgressBar();
            break;
          }
        }
      }
    };
    TasksUiInternal.getTaskList().addChangeListener(taskProgressBarChangeListener);
    
    taskProgressBarActivityListener = new TaskActivityAdapter()
    {
      public void activityReset()
      {
        TaskListFilteredTree.this.updateTaskProgressBar();
      }
    };
    TasksUiPlugin.getTaskActivityManager().addActivityListener(taskProgressBarActivityListener);
    
    taskProgressBarWorkingSetListener = new IPropertyChangeListener()
    {
      public void propertyChange(PropertyChangeEvent event)
      {
        String property = event.getProperty();
        if (("workingSetContentChange".equals(property)) || 
          ("workingSetRemove".equals(property))) {
          TaskListFilteredTree.this.updateTaskProgressBar();
        }
      }
    };
    PlatformUI.getWorkbench().getWorkingSetManager().addPropertyChangeListener(taskProgressBarWorkingSetListener);
    
    return progressComposite;
  }
  
  protected Composite createSearchComposite(Composite container)
  {
    searchComposite = new Composite(container, 0);
    GridLayout searchLayout = new GridLayout(2, false);
    marginHeight = 0;
    marginWidth = 0;
    searchComposite.setLayout(searchLayout);
    searchComposite.setLayoutData(new GridData(4, -1, true, false, 4, 1));
    
    return searchComposite;
  }
  
  private void initSearchComposite()
  {
    searchHandler.createSearchComposite(searchComposite);
    searchHandler.adaptTextSearchControl(getTextSearchControl().getTextControl());
    searchHandler.addFilterChangeListener(new AbstractSearchHandler.IFilterChangeListener()
    {
      public void filterChanged()
      {
        getRefreshPolicy().filterChanged();
      }
    });
    if (SearchUtil.supportsTaskSearch())
    {
      final TaskScalingHyperlink searchLink = new TaskScalingHyperlink(searchComposite, 16384);
      searchLink.setText(LABEL_SEARCH);
      
      searchLink.addHyperlinkListener(new IHyperlinkListener()
      {
        public void linkActivated(HyperlinkEvent e)
        {
          SearchUtil.openSearchDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
        }
        
        public void linkEntered(HyperlinkEvent e)
        {
          searchLink.setUnderlined(true);
        }
        
        public void linkExited(HyperlinkEvent e)
        {
          searchLink.setUnderlined(false);
        }
      });
    }
  }
  
  private void updateTaskProgressBar()
  {
    if (taskProgressBar.isDisposed()) {
      return;
    }
    Set<ITask> tasksThisWeek = TasksUiPlugin.getTaskActivityManager().getScheduledForADayThisWeek();
    ITask task;
    if (workingSetFilter != null) {
      for (Iterator<ITask> it = tasksThisWeek.iterator(); it.hasNext();)
      {
        task = (ITask)it.next();
        if (!workingSetFilter.select(task)) {
          it.remove();
        }
      }
    }
    totalTasks = tasksThisWeek.size();
    completeTime = 0;
    completeTasks = 0;
    incompleteTime = 0;
    for (ITask task : tasksThisWeek) {
      if ((task instanceof AbstractTask))
      {
        AbstractTask abstractTask = (AbstractTask)task;
        if (task.isCompleted())
        {
          completeTasks += 1;
          if (abstractTask.getEstimatedTimeHours() > 0) {
            completeTime += abstractTask.getEstimatedTimeHours();
          } else {
            completeTime += 1;
          }
        }
        else if (abstractTask.getEstimatedTimeHours() > 0)
        {
          incompleteTime += abstractTask.getEstimatedTimeHours();
        }
        else
        {
          incompleteTime += 1;
        }
      }
    }
    PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
    {
      public void run()
      {
        if ((PlatformUI.isWorkbenchRunning()) && (!taskProgressBar.isDisposed()))
        {
          taskProgressBar.reset(completeTime, completeTime + incompleteTime);
          
          taskProgressBar.setToolTipText(Messages.TaskListFilteredTree_Workweek_Progress + 
            "\n" + 
            MessageFormat.format(Messages.TaskListFilteredTree_Estimated_hours, new Object[] { Integer.valueOf(completeTime), 
            Integer.valueOf(completeTime + incompleteTime) }) + 
            "\n" + 
            MessageFormat.format(Messages.TaskListFilteredTree_Scheduled_tasks, new Object[] { Integer.valueOf(completeTasks), 
            Integer.valueOf(totalTasks) }));
        }
      }
    });
  }
  
  protected Composite createActiveWorkingSetComposite(Composite container)
  {
    final ImageHyperlink workingSetButton = new ImageHyperlink(container, 8388608);
    workingSetButton.setImage(CommonImages.getImage(CommonImages.TOOLBAR_ARROW_RIGHT));
    workingSetButton.setToolTipText(Messages.TaskListFilteredTree_Select_Working_Set);
    
    workingSetLink = new TaskScalingHyperlink(container, 16384);
    workingSetLink.setText(TaskWorkingSetAction.LABEL_SETS_NONE);
    workingSetLink.setUnderlined(false);
    
    final TaskWorkingSetAction workingSetAction = new TaskWorkingSetAction();
    workingSetButton.addHyperlinkListener(new IHyperlinkListener()
    {
      public void linkActivated(HyperlinkEvent e)
      {
        workingSetAction.getMenu(workingSetButton).setVisible(true);
      }
      
      public void linkEntered(HyperlinkEvent e)
      {
        workingSetButton.setImage(CommonImages.getImage(CommonImages.TOOLBAR_ARROW_DOWN));
      }
      
      public void linkExited(HyperlinkEvent e)
      {
        workingSetButton.setImage(CommonImages.getImage(CommonImages.TOOLBAR_ARROW_RIGHT));
      }
    });
    workingSetLink.addMouseListener(new MouseAdapter()
    {
      public void mouseDown(MouseEvent e)
      {
        if (currentWorkingSet != null) {
          workingSetAction.run(currentWorkingSet);
        } else {
          workingSetAction.run();
        }
      }
    });
    return workingSetLink;
  }
  
  protected Composite createActiveTaskComposite(final Composite container)
  {
    final ImageHyperlink activeTaskButton = new ImageHyperlink(container, 16384);
    activeTaskButton.setImage(CommonImages.getImage(CommonImages.TOOLBAR_ARROW_RIGHT));
    activeTaskButton.setToolTipText(Messages.TaskListFilteredTree_Select_Active_Task);
    
    activeTaskLink = new TaskScalingHyperlink(container, 16384);
    
    changeListener = new TaskListChangeAdapter()
    {
      public void containersChanged(Set<TaskContainerDelta> containers)
      {
        for (TaskContainerDelta taskContainerDelta : containers) {
          if ((taskContainerDelta.getElement() instanceof ITask))
          {
            final AbstractTask changedTask = (AbstractTask)taskContainerDelta.getElement();
            if ((changedTask.isActive()) && 
              (Platform.isRunning()) && (PlatformUI.getWorkbench() != null)) {
              if (Display.getCurrent() == null)
              {
                if ((PlatformUI.getWorkbench().getDisplay() != null) && 
                  (!PlatformUI.getWorkbench().getDisplay().isDisposed())) {
                  PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
                  {
                    public void run()
                    {
                      indicateActiveTask(changedTask);
                    }
                  });
                }
              }
              else {
                indicateActiveTask(changedTask);
              }
            }
          }
        }
      }
    };
    TasksUiInternal.getTaskList().addChangeListener(changeListener);
    
    activeTaskLink.setText(Messages.TaskListFilteredTree_Activate);
    
    activeTaskLink.setToolTipText("");
    
    taskListToolTip = new TaskListToolTip(activeTaskLink);
    
    ITask activeTask = TasksUi.getTaskActivityManager().getActiveTask();
    if (activeTask != null) {
      indicateActiveTask(activeTask);
    }
    activeTaskButton.addHyperlinkListener(new IHyperlinkListener()
    {
      private Menu dropDownMenu;
      
      public void linkActivated(HyperlinkEvent event)
      {
        if (dropDownMenu != null) {
          dropDownMenu.dispose();
        }
        TaskHistoryDropDown taskHistory = new TaskHistoryDropDown();
        taskHistory.setScopedToWorkingSet(true);
        dropDownMenu = new Menu(activeTaskButton);
        taskHistory.fill(dropDownMenu, 0);
        dropDownMenu.setVisible(true);
      }
      
      public void linkEntered(HyperlinkEvent event)
      {
        activeTaskButton.setImage(CommonImages.getImage(CommonImages.TOOLBAR_ARROW_DOWN));
      }
      
      public void linkExited(HyperlinkEvent event)
      {
        activeTaskButton.setImage(CommonImages.getImage(CommonImages.TOOLBAR_ARROW_RIGHT));
      }
    });
    activeTaskLink.addMenuDetectListener(new MenuDetectListener()
    {
      public void menuDetected(MenuDetectEvent e)
      {
        if ((activeTaskSelectionProvider != null) && (activeSelection != null) && (!activeSelection.isEmpty()))
        {
          activeTaskLink.setFocus();
          
          activeTaskSelectionProvider.setSelection(activeSelection);
          
          Menu activeTaskMenu = activeTaskMenuManager.createContextMenu(container);
          activeTaskMenu.setVisible(true);
        }
      }
    });
    activeTaskLink.addMouseListener(new MouseAdapter()
    {
      public void mouseDown(MouseEvent e)
      {
        if (button == 1)
        {
          ITask activeTask = TasksUi.getTaskActivityManager().getActiveTask();
          if (activeTask == null)
          {
            ActivateTaskDialogAction activateAction = new ActivateTaskDialogAction();
            activateAction.init(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
            activateAction.run(null);
          }
          else
          {
            TasksUiInternal.refreshAndOpenTaskListElement(activeTask);
          }
        }
      }
    });
    return activeTaskLink;
  }
  
  protected void textChanged()
  {
    super.textChanged();
    if ((getFilterString() != null) && (!getFilterString().trim().equals(""))) {
      setShowSearch(true);
    } else {
      setShowSearch(false);
    }
  }
  
  public void indicateActiveTaskWorkingSet()
  {
    if ((window == null) || (workingSetLink == null) || (filterComposite == null) || (filterComposite.isDisposed())) {
      return;
    }
    Set<IWorkingSet> activeSets = TaskWorkingSetUpdater.getActiveWorkingSets(window);
    if (activeSets == null) {
      return;
    }
    if (activeSets.size() == 0)
    {
      workingSetLink.setText(TaskWorkingSetAction.LABEL_SETS_NONE);
      workingSetLink.setToolTipText(Messages.TaskListFilteredTree_Edit_Task_Working_Sets_);
      currentWorkingSet = null;
    }
    else if (activeSets.size() > 1)
    {
      workingSetLink.setText(Messages.TaskListFilteredTree__multiple_);
      workingSetLink.setToolTipText(Messages.TaskListFilteredTree_Edit_Task_Working_Sets_);
      currentWorkingSet = null;
    }
    else
    {
      Object[] array = activeSets.toArray();
      IWorkingSet workingSet = (IWorkingSet)array[0];
      workingSetLink.setText(workingSet.getLabel());
      workingSetLink.setToolTipText(Messages.TaskListFilteredTree_Edit_Task_Working_Sets_);
      currentWorkingSet = workingSet;
    }
    relayoutFilterControls();
  }
  
  public void indicateActiveTask(ITask task)
  {
    if (Display.getCurrent() != null)
    {
      if (filterComposite.isDisposed()) {
        return;
      }
      activeTaskLink.setTask(task);
      activeSelection = new StructuredSelection(task);
      
      relayoutFilterControls();
    }
  }
  
  private void relayoutFilterControls()
  {
    filterComposite.layout();
  }
  
  public String getActiveTaskLabelText()
  {
    return activeTaskLink.getText();
  }
  
  public void indicateNoActiveTask()
  {
    if (filterComposite.isDisposed()) {
      return;
    }
    activeTaskLink.setTask(null);
    activeTaskLink.setText(Messages.TaskListFilteredTree_Activate);
    activeTaskLink.setToolTipText("");
    activeSelection = StructuredSelection.EMPTY;
    
    relayoutFilterControls();
  }
  
  public void setFilterText(String string)
  {
    if (filterText != null)
    {
      filterText.setText(string);
      selectAll();
    }
  }
  
  protected String getFilterString()
  {
    String text = super.getFilterString();
    return text != null ? text.trim() : null;
  }
  
  public TaskWorkingSetFilter getWorkingSetFilter()
  {
    return workingSetFilter;
  }
  
  public void setWorkingSetFilter(TaskWorkingSetFilter workingSetFilter)
  {
    this.workingSetFilter = workingSetFilter;
  }
  
  public MenuManager getActiveTaskMenuManager()
  {
    return activeTaskMenuManager;
  }
  
  public SelectionProviderAdapter getActiveTaskSelectionProvider()
  {
    return activeTaskSelectionProvider;
  }
  
  public void setActiveTaskSelectionProvider(SelectionProviderAdapter activeTaskSelectionProvider)
  {
    this.activeTaskSelectionProvider = activeTaskSelectionProvider;
    actionGroup.setSelectionProvider(activeTaskSelectionProvider);
  }
  
  protected SearchHistoryPopupDialog getHistoryPopupDialog()
  {
    return null;
  }
}

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

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Control;

class TaskRepositoriesNavigatorContentProvider$Listener$1
  implements Runnable
{
  TaskRepositoriesNavigatorContentProvider$Listener$1(TaskRepositoriesNavigatorContentProvider.Listener paramListener) {}
  
  public void run()
  {
    if ((TaskRepositoriesNavigatorContentProvider.access$0(TaskRepositoriesNavigatorContentProvider.Listener.access$1(this$1)) != null) && (TaskRepositoriesNavigatorContentProvider.access$0(TaskRepositoriesNavigatorContentProvider.Listener.access$1(this$1)).getControl() != null) && (!TaskRepositoriesNavigatorContentProvider.access$0(TaskRepositoriesNavigatorContentProvider.Listener.access$1(this$1)).getControl().isDisposed())) {
      TaskRepositoriesNavigatorContentProvider.access$0(TaskRepositoriesNavigatorContentProvider.Listener.access$1(this$1)).refresh();
    }
  }
}

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

import java.text.MessageFormat;
import java.util.Iterator;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
import org.eclipse.mylyn.internal.tasks.ui.actions.AbstractTaskRepositoryAction;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

public class UpdateRepositoryConfigurationAction
  extends AbstractTaskRepositoryAction
{
  private static final String ID = "org.eclipse.mylyn.tasklist.repositories.reset";
  
  public UpdateRepositoryConfigurationAction()
  {
    super(Messages.UpdateRepositoryConfigurationAction_Update_Repository_Configuration);
    setId("org.eclipse.mylyn.tasklist.repositories.reset");
    setEnabled(false);
  }
  
  public void run()
  {
    IStructuredSelection selection = getStructuredSelection();
    for (Iterator<?> iter = selection.iterator(); iter.hasNext();)
    {
      final TaskRepository repository = getTaskRepository(iter.next());
      if (repository != null)
      {
        final AbstractRepositoryConnector connector = TasksUi.getRepositoryManager().getRepositoryConnector(
          repository.getConnectorKind());
        if (connector != null)
        {
          final String jobName = MessageFormat.format(
            Messages.UpdateRepositoryConfigurationAction_Updating_repository_configuration_for_X, new Object[] {
            repository.getRepositoryUrl() });
          Job updateJob = new Job(jobName)
          {
            /* Error */
            protected org.eclipse.core.runtime.IStatus run(IProgressMonitor monitor)
            {
              // Byte code:
              //   0: aload_1
              //   1: aload_0
              //   2: getfield 48	org/eclipse/mylyn/internal/tasks/ui/views/UpdateRepositoryConfigurationAction$1:val$jobName	Ljava/lang/String;
              //   5: iconst_m1
              //   6: invokeinterface 55 3 0
              //   11: aload_0
              //   12: getfield 49	org/eclipse/mylyn/internal/tasks/ui/views/UpdateRepositoryConfigurationAction$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/views/UpdateRepositoryConfigurationAction;
              //   15: aload_0
              //   16: getfield 51	org/eclipse/mylyn/internal/tasks/ui/views/UpdateRepositoryConfigurationAction$1:val$repository	Lorg/eclipse/mylyn/tasks/core/TaskRepository;
              //   19: aload_0
              //   20: getfield 50	org/eclipse/mylyn/internal/tasks/ui/views/UpdateRepositoryConfigurationAction$1:val$connector	Lorg/eclipse/mylyn/tasks/core/AbstractRepositoryConnector;
              //   23: aload_1
              //   24: invokevirtual 53	org/eclipse/mylyn/internal/tasks/ui/views/UpdateRepositoryConfigurationAction:performUpdate	(Lorg/eclipse/mylyn/tasks/core/TaskRepository;Lorg/eclipse/mylyn/tasks/core/AbstractRepositoryConnector;Lorg/eclipse/core/runtime/IProgressMonitor;)V
              //   27: goto +12 -> 39
              //   30: astore_2
              //   31: aload_1
              //   32: invokeinterface 54 1 0
              //   37: aload_2
              //   38: athrow
              //   39: aload_1
              //   40: invokeinterface 54 1 0
              //   45: getstatic 47	org/eclipse/core/runtime/Status:OK_STATUS	Lorg/eclipse/core/runtime/IStatus;
              //   48: areturn
              // Line number table:
              //   Java source line #59	-> byte code offset #0
              //   Java source line #61	-> byte code offset #11
              //   Java source line #62	-> byte code offset #30
              //   Java source line #63	-> byte code offset #31
              //   Java source line #64	-> byte code offset #37
              //   Java source line #63	-> byte code offset #39
              //   Java source line #65	-> byte code offset #45
              // Local variable table:
              //   start	length	slot	name	signature
              //   0	49	0	this	1
              //   0	49	1	monitor	IProgressMonitor
              //   30	8	2	localObject	Object
              // Exception table:
              //   from	to	target	type
              //   11	30	30	finally
            }
          };
          updateJob.setProperty(WorkbenchUtil.SHOW_IN_TASKBAR_ICON_PROPERTY, Boolean.TRUE);
          updateJob.setUser(true);
          updateJob.schedule();
        }
      }
    }
  }
  
  public void performUpdate(TaskRepository repository, AbstractRepositoryConnector connector, IProgressMonitor monitor)
  {
    try
    {
      connector.updateRepositoryConfiguration(repository, monitor);
    }
    catch (CoreException e)
    {
      PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
      {
        public void run()
        {
          TasksUiInternal.displayStatus(
            Messages.UpdateRepositoryConfigurationAction_Error_updating_repository_configuration, 
            e.getStatus());
        }
      });
    }
  }
}

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

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.tasks.ui.views.messages";
  public static String DisconnectRepositoryAction_Disconnected;
  public static String PriorityDropDownAction_Filter_Priority_Lower_Than;
  public static String RepositoryElementActionGroup_Copy_Detail_Menu_Label;
  public static String RepositoryElementActionGroup_New;
  public static String TaskListDropAdapter__retrieving_from_URL_;
  public static String TaskListFilteredTree_Activate;
  public static String TaskListFilteredTree_Edit_Task_Working_Sets_;
  public static String TaskListFilteredTree_Estimated_hours;
  public static String TaskListFilteredTree__multiple_;
  public static String TaskListFilteredTree_Scheduled_tasks;
  public static String TaskListFilteredTree_Search_repository_for_key_or_summary_;
  public static String TaskListFilteredTree_Select_Active_Task;
  public static String TaskListFilteredTree_Select_Working_Set;
  public static String TaskListFilteredTree_Workweek_Progress;
  public static String TaskListSorter_Catagory_and_Query;
  public static String TaskListSorter_Catagory_and_Repository;
  public static String TaskListSorter_No_Grouping;
  public static String TaskListToolTip_Active_X;
  public static String TaskListToolTip_Assigned_to_X;
  public static String TaskListToolTip_Automatic_container_for_all_local_tasks;
  public static String TaskListToolTip_Automatic_container_for_repository_tasks;
  public static String TaskListToolTip_Due;
  public static String TaskListToolTip_Estimate;
  public static String TaskListToolTip_Please_synchronize_manually_for_full_error_message;
  public static String TaskListToolTip_Scheduled;
  public static String TaskListToolTip_Some_incoming_elements_may_be_filtered;
  public static String TaskListToolTip_Synchronized;
  public static String TaskListToolTip_Total_Complete_Incomplete;
  public static String TaskListView_Mylyn_context_capture_paused;
  public static String TaskListView__paused_;
  public static String TaskListView_Advanced_Filters_Label;
  public static String TaskListView_Repository;
  public static String TaskListView_Summary;
  public static String TaskListView_Task_List;
  public static String TaskListView_Welcome_Message;
  public static String TaskListView_Welcome_Message_Title;
  public static String TaskScheduleContentProvider_Completed;
  public static String TaskScheduleContentProvider_Future;
  public static String TaskScheduleContentProvider_Incoming;
  public static String TaskScheduleContentProvider_Outgoing;
  public static String TaskScheduleContentProvider_Two_Weeks;
  public static String TaskScheduleContentProvider_Unscheduled;
  public static String UpdateRepositoryConfigurationAction_Error_updating_repository_configuration;
  public static String UpdateRepositoryConfigurationAction_Update_Repository_Configuration;
  public static String UpdateRepositoryConfigurationAction_Updating_repository_configuration_for_X;
  
  static {}
  
  public static void reloadMessages()
  {
    NLS.initializeMessages("org.eclipse.mylyn.internal.tasks.ui.views.messages", Messages.class);
  }
}

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

import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.mylyn.commons.workbench.GradientDrawer;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.ui.themes.IThemeManager;

class TaskListView$16
  extends GradientDrawer
{
  TaskListView$16(TaskListView paramTaskListView, IThemeManager $anonymous0, TreeViewer $anonymous1)
  {
    super($anonymous0, $anonymous1);
  }
  
  protected boolean shouldApplyGradient(Event event)
  {
    return ((item.getData() instanceof ITaskContainer)) && (!(item.getData() instanceof ITask));
  }
}

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

import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.resource.LocalResourceManager;
import org.eclipse.mylyn.commons.ui.GradientCanvas;
import org.eclipse.mylyn.commons.ui.GradientColors;
import org.eclipse.mylyn.commons.ui.compatibility.CommonColors;
import org.eclipse.mylyn.commons.workbench.search.SearchHistoryPopupDialog;
import org.eclipse.mylyn.internal.tasks.ui.search.SearchUtil;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.ImageHyperlink;

public class TaskListSearchHistoryPopupDialog
  extends SearchHistoryPopupDialog
{
  private static GradientColors colors;
  private LocalResourceManager resourceManager;
  
  public TaskListSearchHistoryPopupDialog(Shell parent, int side)
  {
    super(parent, side);
  }
  
  protected void createAdditionalSearchRegion(Composite composite)
  {
    if (!SearchUtil.supportsTaskSearch()) {
      return;
    }
    resourceManager = new LocalResourceManager(JFaceResources.getResources());
    colors = new GradientColors(composite.getDisplay(), resourceManager);
    
    GradientCanvas gradient = new GradientCanvas(composite, 0);
    
    gradient.setBackgroundGradient(new Color[] { colors.getGradientBegin(), colors.getGradientEnd() }, 
      new int[] { 100 }, true);
    
    GridLayout headLayout = new GridLayout();
    marginHeight = 5;
    marginWidth = 5;
    horizontalSpacing = 0;
    verticalSpacing = 0;
    gradient.setLayout(headLayout);
    gradient.setLayoutData(new GridData(768));
    
    gradient.setSeparatorVisible(true);
    gradient.setSeparatorAlignment(128);
    
    Composite editContainer = new Composite(gradient, 0);
    GridLayout editLayout = new GridLayout();
    marginHeight = 0;
    marginWidth = 0;
    editContainer.setLayout(editLayout);
    editContainer.setLayoutData(new GridData(2, 2, true, true));
    
    ImageHyperlink advancedSearchButton = new ImageHyperlink(editContainer, 0);
    advancedSearchButton.setUnderlined(true);
    advancedSearchButton.setForeground(CommonColors.HYPERLINK_WIDGET);
    advancedSearchButton.setText(TaskListFilteredTree.LABEL_SEARCH);
    advancedSearchButton.addHyperlinkListener(new HyperlinkAdapter()
    {
      public void linkActivated(Hype
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