org.eclipse.mylar.internal.tasks.ui.views
Class TaskListView

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.ViewPart
              extended by org.eclipse.mylar.internal.tasks.ui.views.TaskListView
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IPersistable, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.part.IWorkbenchPartOrientation

public class TaskListView
extends org.eclipse.ui.part.ViewPart

Author:
Mik Kersten, Ken Sueda

Nested Class Summary
(package private)  class TaskListView.TaskListCellModifier
           
 
Field Summary
private  TaskActivateAction activateAction
           
private  CollapseAllAction collapseAll
           
protected  java.lang.String[] columnNames
           
private  org.eclipse.swt.widgets.TreeColumn[] columns
           
static java.lang.String columnWidthIdentifier
           
protected  int[] columnWidths
           
private  CopyTaskDetailsAction copyDetailsAction
           
private  TaskDeactivateAction deactivateAction
           
private static int DEFAULT_SORT_DIRECTION
           
private  DeleteAction deleteAction
           
private  org.eclipse.ui.part.DrillDownAdapter drillDownAdapter
           
private  AbstractTaskContainer drilledIntoCategory
           
private  ExpandAllAction expandAll
           
private static TaskArchiveFilter FILTER_ARCHIVE
           
private static TaskCompletionFilter FILTER_COMPLETE
           
(package private) static TaskPriorityFilter FILTER_PRIORITY
           
private  FilterArchiveContainerAction filterArchiveCategory
           
private  FilterCompletedTasksAction filterCompleteTask
           
private  TaskListFilteredTree filteredTree
           
private  PriorityDropDownAction filterOnPriority
           
private  java.util.Set<AbstractTaskListFilter> filters
           
private  boolean focusedMode
           
private  GoIntoAction goIntoAction
           
private  GoUpAction goUpAction
           
static java.lang.String ID
           
private static java.lang.String ID_SEPARATOR_CONTEXT
           
private static java.lang.String ID_SEPARATOR_FILTERS
           
private static java.lang.String ID_SEPARATOR_NAVIGATION
           
private static java.lang.String ID_SEPARATOR_NEW
           
private static java.lang.String ID_SEPARATOR_REPOSITORY
           
private static java.lang.String ID_SEPARATOR_TASKS
           
private  boolean isInRenameAction
           
protected  boolean isPaused
          True if the view should indicate that interaction monitoring is paused
private static java.lang.String LABEL_NO_TASKS
           
static java.lang.String LABEL_VIEW
           
private static java.lang.String MEMENTO_KEY_SORT_DIRECTION
           
private static java.lang.String MEMENTO_KEY_SORT_INDEX
           
private static java.lang.String MEMENTO_KEY_SORTER
           
private static java.lang.String MEMENTO_KEY_WIDTH
           
private  NewLocalTaskAction newLocalTaskAction
           
private  OpenTaskListElementAction openAction
           
private  OpenWithBrowserAction openWithBrowser
           
private static java.lang.String PART_NAME
           
private  PreviousTaskDropDownAction previousTaskAction
           
static java.lang.String[] PRIORITY_LEVEL_DESCRIPTIONS
           
(package private) static java.lang.String[] PRIORITY_LEVELS
           
private  TaskListElementPropertiesAction propertiesAction
           
private  RemoveFromCategoryAction removeFromCategoryAction
           
private  RenameAction renameAction
           
(package private)  int sortDirection
           
private  int sortIndex
           
private  TaskListTableSorter tableSorter
           
static java.lang.String tableSortIdentifier
           
private  ITaskActivityListener TASK_ACTIVITY_LISTENER
           
private  ITaskListChangeListener TASK_REFERESH_LISTENER
           
private  org.eclipse.ui.IMemento taskListMemento
           
private  TaskListTableLabelProvider taskListTableLabelProvider
           
private  org.eclipse.jface.util.IPropertyChangeListener THEME_CHANGE_LISTENER
           
private  org.eclipse.ui.themes.IThemeManager themeManager
           
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
TaskListView()
           
 
Method Summary
private  void addAction(org.eclipse.jface.action.Action action, org.eclipse.jface.action.IMenuManager manager, ITaskListElement element)
           
 void addFilter(AbstractTaskListFilter filter)
           
private  void addMenuManager(org.eclipse.jface.action.IMenuManager menuToAdd, org.eclipse.jface.action.IMenuManager manager, ITaskListElement element)
           
 void addTaskToHistory(ITask task)
           
 void clearFilters(boolean preserveArchiveFilter)
           
private  void contributeToActionBars()
           
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
           
 void dispose()
           
(package private)  void expandToActiveTasks()
           
private  void fillContextMenu(org.eclipse.jface.action.IMenuManager manager)
           
private  void fillLocalPullDown(org.eclipse.jface.action.IMenuManager manager)
           
private  void fillLocalToolBar(org.eclipse.jface.action.IToolBarManager manager)
           
 TaskArchiveFilter getArchiveFilter()
           
 java.lang.String getBugIdFromUser()
           
 TaskCompletionFilter getCompleteFilter()
           
static java.lang.String getCurrentPriorityLevel()
           
 AbstractTaskContainer getDrilledIntoCategory()
           
 org.eclipse.swt.widgets.Composite getDummyComposite()
          HACK: This is used for the copy action
 TaskListFilteredTree getFilteredTree()
           
 java.util.Set<AbstractTaskListFilter> getFilters()
           
static TaskListView getFromActivePerspective()
           
 org.eclipse.swt.graphics.Image[] getPirorityImages()
           
 PreviousTaskDropDownAction getPreviousTaskAction()
           
 TaskPriorityFilter getPriorityFilter()
           
 ITask getSelectedTask()
           
static ITask getSelectedTask(org.eclipse.jface.viewers.ISelection selection)
           
 org.eclipse.jface.viewers.TreeViewer getViewer()
           
 void goIntoCategory()
           
 void goUpToRoot()
           
private  void hookContextMenu()
           
private  void hookOpenAction()
           
 void indicatePaused(boolean paused)
           
 void init(org.eclipse.ui.IViewSite site, org.eclipse.ui.IMemento memento)
           
private  void initDragAndDrop(org.eclipse.swt.widgets.Composite parent)
           
 boolean isFocusedMode()
           
protected  boolean lookForId(java.lang.String taskId)
          Recursive function that checks for the occurrence of a certain task id.
private  void makeActions()
           
static TaskListView openInActivePerspective()
           
private  void refresh(ITaskListElement element)
          Encapsulates refresh policy.
 void refreshAndFocus(boolean expand)
           
 void removeFilter(AbstractTaskListFilter filter)
           
private  void restoreState()
           
 void saveState(org.eclipse.ui.IMemento memento)
           
 void selectedAndFocusTask(ITask task)
           
 void setFocus()
          Passing the focus request to the viewer's control.
 void setFocusedMode(boolean focusedMode)
           
 void setInRenameAction(boolean b)
           
 void setManualFiltersEnabled(boolean enabled)
           
 void togglePreviousAction(boolean enable)
           
private  void updateActionEnablement(org.eclipse.jface.action.Action action, ITaskListElement element)
          Refactor out element
private  void updateDescription(ITask task)
          TODO: should be updated when view mode switches to fast and vice-versa
 void updateDrillDownActions()
           
 
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

ID

public static final java.lang.String ID
See Also:
Constant Field Values

LABEL_VIEW

public static final java.lang.String LABEL_VIEW
See Also:
Constant Field Values

MEMENTO_KEY_SORT_DIRECTION

private static final java.lang.String MEMENTO_KEY_SORT_DIRECTION
See Also:
Constant Field Values

MEMENTO_KEY_SORTER

private static final java.lang.String MEMENTO_KEY_SORTER
See Also:
Constant Field Values

MEMENTO_KEY_SORT_INDEX

private static final java.lang.String MEMENTO_KEY_SORT_INDEX
See Also:
Constant Field Values

MEMENTO_KEY_WIDTH

private static final java.lang.String MEMENTO_KEY_WIDTH
See Also:
Constant Field Values

ID_SEPARATOR_NEW

private static final java.lang.String ID_SEPARATOR_NEW
See Also:
Constant Field Values

ID_SEPARATOR_CONTEXT

private static final java.lang.String ID_SEPARATOR_CONTEXT
See Also:
Constant Field Values

ID_SEPARATOR_TASKS

private static final java.lang.String ID_SEPARATOR_TASKS
See Also:
Constant Field Values

ID_SEPARATOR_NAVIGATION

private static final java.lang.String ID_SEPARATOR_NAVIGATION
See Also:
Constant Field Values

ID_SEPARATOR_FILTERS

private static final java.lang.String ID_SEPARATOR_FILTERS
See Also:
Constant Field Values

ID_SEPARATOR_REPOSITORY

private static final java.lang.String ID_SEPARATOR_REPOSITORY
See Also:
Constant Field Values

LABEL_NO_TASKS

private static final java.lang.String LABEL_NO_TASKS
See Also:
Constant Field Values

PRIORITY_LEVELS

static final java.lang.String[] PRIORITY_LEVELS

PRIORITY_LEVEL_DESCRIPTIONS

public static final java.lang.String[] PRIORITY_LEVEL_DESCRIPTIONS

PART_NAME

private static final java.lang.String PART_NAME
See Also:
Constant Field Values

focusedMode

private boolean focusedMode

themeManager

private org.eclipse.ui.themes.IThemeManager themeManager

filteredTree

private TaskListFilteredTree filteredTree

drillDownAdapter

private org.eclipse.ui.part.DrillDownAdapter drillDownAdapter

drilledIntoCategory

private AbstractTaskContainer drilledIntoCategory

goIntoAction

private GoIntoAction goIntoAction

goUpAction

private GoUpAction goUpAction

copyDetailsAction

private CopyTaskDetailsAction copyDetailsAction

openAction

private OpenTaskListElementAction openAction

propertiesAction

private TaskListElementPropertiesAction propertiesAction

openWithBrowser

private OpenWithBrowserAction openWithBrowser

newLocalTaskAction

private NewLocalTaskAction newLocalTaskAction

renameAction

private RenameAction renameAction

collapseAll

private CollapseAllAction collapseAll

expandAll

private ExpandAllAction expandAll

deleteAction

private DeleteAction deleteAction

removeFromCategoryAction

private RemoveFromCategoryAction removeFromCategoryAction

activateAction

private TaskActivateAction activateAction

deactivateAction

private TaskDeactivateAction deactivateAction

filterCompleteTask

private FilterCompletedTasksAction filterCompleteTask

filterArchiveCategory

private FilterArchiveContainerAction filterArchiveCategory

filterOnPriority

private PriorityDropDownAction filterOnPriority

previousTaskAction

private PreviousTaskDropDownAction previousTaskAction

FILTER_PRIORITY

static TaskPriorityFilter FILTER_PRIORITY

FILTER_COMPLETE

private static TaskCompletionFilter FILTER_COMPLETE

FILTER_ARCHIVE

private static TaskArchiveFilter FILTER_ARCHIVE

filters

private java.util.Set<AbstractTaskListFilter> filters

columnNames

protected java.lang.String[] columnNames

columnWidths

protected int[] columnWidths

columns

private org.eclipse.swt.widgets.TreeColumn[] columns

taskListMemento

private org.eclipse.ui.IMemento taskListMemento

columnWidthIdentifier

public static final java.lang.String columnWidthIdentifier
See Also:
Constant Field Values

tableSortIdentifier

public static final java.lang.String tableSortIdentifier
See Also:
Constant Field Values

DEFAULT_SORT_DIRECTION

private static final int DEFAULT_SORT_DIRECTION
See Also:
Constant Field Values

sortIndex

private int sortIndex

taskListTableLabelProvider

private TaskListTableLabelProvider taskListTableLabelProvider

tableSorter

private TaskListTableSorter tableSorter

sortDirection

int sortDirection

isPaused

protected boolean isPaused
True if the view should indicate that interaction monitoring is paused


TASK_ACTIVITY_LISTENER

private final ITaskActivityListener TASK_ACTIVITY_LISTENER

TASK_REFERESH_LISTENER

private final ITaskListChangeListener TASK_REFERESH_LISTENER

THEME_CHANGE_LISTENER

private final org.eclipse.jface.util.IPropertyChangeListener THEME_CHANGE_LISTENER

isInRenameAction

private boolean isInRenameAction
Constructor Detail

TaskListView

public TaskListView()
Method Detail

getFromActivePerspective

public static TaskListView getFromActivePerspective()

openInActivePerspective

public static TaskListView openInActivePerspective()

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.ui.part.WorkbenchPart

updateDescription

private void updateDescription(ITask task)
TODO: should be updated when view mode switches to fast and vice-versa


addTaskToHistory

public void addTaskToHistory(ITask task)

init

public void init(org.eclipse.ui.IViewSite site,
                 org.eclipse.ui.IMemento memento)
          throws org.eclipse.ui.PartInitException
Specified by:
init in interface org.eclipse.ui.IViewPart
Overrides:
init in class org.eclipse.ui.part.ViewPart
Throws:
org.eclipse.ui.PartInitException

saveState

public void saveState(org.eclipse.ui.IMemento memento)
Specified by:
saveState in interface org.eclipse.ui.IPersistable
Specified by:
saveState in interface org.eclipse.ui.IViewPart
Overrides:
saveState in class org.eclipse.ui.part.ViewPart

restoreState

private void restoreState()

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
Specified by:
createPartControl in class org.eclipse.ui.part.WorkbenchPart

initDragAndDrop

private void initDragAndDrop(org.eclipse.swt.widgets.Composite parent)

expandToActiveTasks

void expandToActiveTasks()

hookContextMenu

private void hookContextMenu()

contributeToActionBars

private void contributeToActionBars()

fillLocalPullDown

private void fillLocalPullDown(org.eclipse.jface.action.IMenuManager manager)

fillLocalToolBar

private void fillLocalToolBar(org.eclipse.jface.action.IToolBarManager manager)

fillContextMenu

private void fillContextMenu(org.eclipse.jface.action.IMenuManager manager)

addMenuManager

private void addMenuManager(org.eclipse.jface.action.IMenuManager menuToAdd,
                            org.eclipse.jface.action.IMenuManager manager,
                            ITaskListElement element)

addAction

private void addAction(org.eclipse.jface.action.Action action,
                       org.eclipse.jface.action.IMenuManager manager,
                       ITaskListElement element)

updateActionEnablement

private void updateActionEnablement(org.eclipse.jface.action.Action action,
                                    ITaskListElement element)
Refactor out element


makeActions

private void makeActions()

togglePreviousAction

public void togglePreviousAction(boolean enable)

getPreviousTaskAction

public PreviousTaskDropDownAction getPreviousTaskAction()

lookForId

protected boolean lookForId(java.lang.String taskId)
Recursive function that checks for the occurrence of a certain task id. All children of the supplied node will be checked.

Parameters:
task - The ITask object that is to be searched.
taskId - The id that is being searched for.
Returns:
true if the id was found in the node or any of its children

hookOpenAction

private void hookOpenAction()

setFocus

public void setFocus()
Passing the focus request to the viewer's control.

Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart
Specified by:
setFocus in class org.eclipse.ui.part.WorkbenchPart

getBugIdFromUser

public java.lang.String getBugIdFromUser()

refreshAndFocus

public void refreshAndFocus(boolean expand)

getViewer

public org.eclipse.jface.viewers.TreeViewer getViewer()

getCompleteFilter

public TaskCompletionFilter getCompleteFilter()

getPriorityFilter

public TaskPriorityFilter getPriorityFilter()

addFilter

public void addFilter(AbstractTaskListFilter filter)

clearFilters

public void clearFilters(boolean preserveArchiveFilter)

removeFilter

public void removeFilter(AbstractTaskListFilter filter)

updateDrillDownActions

public void updateDrillDownActions()

getDummyComposite

public org.eclipse.swt.widgets.Composite getDummyComposite()
HACK: This is used for the copy action


setInRenameAction

public void setInRenameAction(boolean b)

goIntoCategory

public void goIntoCategory()

goUpToRoot

public void goUpToRoot()

getSelectedTask

public ITask getSelectedTask()

getSelectedTask

public static ITask getSelectedTask(org.eclipse.jface.viewers.ISelection selection)

indicatePaused

public void indicatePaused(boolean paused)

getDrilledIntoCategory

public AbstractTaskContainer getDrilledIntoCategory()

getFilteredTree

public TaskListFilteredTree getFilteredTree()

selectedAndFocusTask

public void selectedAndFocusTask(ITask task)

refresh

private void refresh(ITaskListElement element)
Encapsulates refresh policy.


getPirorityImages

public org.eclipse.swt.graphics.Image[] getPirorityImages()

getFilters

public java.util.Set<AbstractTaskListFilter> getFilters()

getCurrentPriorityLevel

public static java.lang.String getCurrentPriorityLevel()

getArchiveFilter

public TaskArchiveFilter getArchiveFilter()

setManualFiltersEnabled

public void setManualFiltersEnabled(boolean enabled)

isFocusedMode

public boolean isFocusedMode()

setFocusedMode

public void setFocusedMode(boolean focusedMode)