Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-06-03 18:56:10 -0400
committerspingel2010-06-03 18:56:10 -0400
commit4572884d3afcf9a09d6574de8096fa29b6a0f690 (patch)
tree724aa962b0401f472787d7f9dc81531710a2b510 /org.eclipse.mylyn.tasks.ui
parent873a2e9ac93e65487f4cbc998a6e5a62252ff260 (diff)
downloadorg.eclipse.mylyn.tasks-4572884d3afcf9a09d6574de8096fa29b6a0f690.tar.gz
org.eclipse.mylyn.tasks-4572884d3afcf9a09d6574de8096fa29b6a0f690.tar.xz
org.eclipse.mylyn.tasks-4572884d3afcf9a09d6574de8096fa29b6a0f690.zip
NEW - bug 315534: [sandbox] TaskTrimWidget keeps references to CopyDetailsAction
https://bugs.eclipse.org/bugs/show_bug.cgi?id=315534
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/Messages.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java5
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/messages.properties1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java5
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java42
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java5
8 files changed, 46 insertions, 22 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java
index f77b077e7..ea8ab961b 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java
@@ -128,6 +128,8 @@ public class TaskTrimWidget extends WorkbenchWindowControlContribution {
private SelectionProviderAdapter activeTaskSelectionProvider;
+ private RepositoryElementActionGroup actionGroup;
+
public TaskTrimWidget() {
TasksUi.getTaskActivityManager().addActivationListener(taskActivationListener);
TasksUiPlugin.getTaskList().addChangeListener(taskListListener);
@@ -164,6 +166,8 @@ public class TaskTrimWidget extends WorkbenchWindowControlContribution {
}
menu = null;
+ actionGroup.setSelectionProvider(null);
+
TasksUi.getTaskActivityManager().removeActivationListener(taskActivationListener);
TasksUiPlugin.getTaskList().removeChangeListener(taskListListener);
TasksUiPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(preferencesListener);
@@ -260,7 +264,7 @@ public class TaskTrimWidget extends WorkbenchWindowControlContribution {
private void hookContextMenu() {
activeTaskSelectionProvider = new SelectionProviderAdapter();
- final RepositoryElementActionGroup actionGroup = new RepositoryElementActionGroup();
+ actionGroup = new RepositoryElementActionGroup();
actionGroup.setSelectionProvider(activeTaskSelectionProvider);
menuManager = new MenuManager("#PopupMenu"); //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java
index feee8791a..b2cc54e3f 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java
@@ -54,7 +54,7 @@ public class CopyTaskDetailsAction extends BaseSelectionListenerAction {
setText(Messages.CopyTaskDetailsAction_Url_Menu_Label);
break;
case SUMMARY:
- setText("Summary");
+ setText(Messages.CopyTaskDetailsAction_Summary_Menu_Label);
break;
case SUMMARY_URL:
setText(Messages.CopyTaskDetailsAction_Summary_and_Url_Menu_Label);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/Messages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/Messages.java
index 08565b7a1..e4b266de6 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/Messages.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/Messages.java
@@ -77,6 +77,8 @@ public class Messages extends NLS {
public static String CopyTaskDetailsAction_Summary_and_Url_Menu_Label;
+ public static String CopyTaskDetailsAction_Summary_Menu_Label;
+
public static String CopyTaskDetailsAction_Url_Menu_Label;
public static String DeleteAction_Also_delete_from_repository_X;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java
index d86b433c9..423bcd2f2 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java
@@ -45,6 +45,11 @@ public class TaskListViewActionGroup extends RepositoryElementActionGroup {
setSelectionProvider(view.getViewer());
}
+ public void dispose() {
+ view.getViewer().removeSelectionChangedListener(renameAction);
+ setSelectionProvider(null);
+ }
+
public void updateDrillDownActions() {
if (drillDownAdapter.canGoBack()) {
goUpAction.setEnabled(true);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/messages.properties b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/messages.properties
index 080527015..7f9ef4589 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/messages.properties
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/messages.properties
@@ -44,6 +44,7 @@ CopyCommenterNameAction_Copy_User_Name_Tooltip=Copy User Name of Comment Author
CopyTaskDetailsAction_ID_Menu_Label=ID
CopyTaskDetailsAction_Summary_and_Url_Menu_Label=Summary and URL
+CopyTaskDetailsAction_Summary_Menu_Label=Summary
CopyTaskDetailsAction_Url_Menu_Label=URL
DeleteAction_Also_delete_from_repository_X=Also delete from repository. {0}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java
index c30ceb6fd..1edec96d2 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java
@@ -147,6 +147,11 @@ public class TaskEditorActionContributor extends MultiPageEditorActionBarContrib
public void contributeToToolBar(IToolBarManager tbm) {
}
+ @Override
+ public void dispose() {
+ actionGroup.setSelectionProvider(null);
+ }
+
public void forceActionsEnabled() {
actionSupport.forceEditActionsEnabled();
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java
index 6da1ee62e..d15860070 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java
@@ -46,6 +46,8 @@ import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.TaskActivityAdapter;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.swt.SWT;
+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;
@@ -119,26 +121,26 @@ public class TaskListFilteredTree extends AbstractFilteredTree {
hookContextMenu();
this.window = window;
indicateActiveTaskWorkingSet();
- }
-
- @Override
- public void dispose() {
- 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);
- }
- activeTaskMenuManager.dispose();
- super.dispose();
- taskListToolTip.dispose();
+ 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() {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
index b1acd9c1e..b3ca158a6 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
@@ -565,6 +565,11 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener, I
@Override
public void dispose() {
super.dispose();
+
+ if (actionGroup != null) {
+ actionGroup.dispose();
+ }
+
TasksUiPlugin.getDefault().getServiceMessageManager().removeServiceMessageListener(serviceMessageControl);
TasksUiPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(tasksUiPreferenceListener);
TasksUiInternal.getTaskList().removeChangeListener(TASKLIST_CHANGE_LISTENER);

Back to the top