Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-03-25 19:06:29 +0000
committerJean Michel-Lemieux2004-03-25 19:06:29 +0000
commit549de2058ecca62651f2d2003bc16a37cda523d7 (patch)
tree8a230e01502f97fb900424c382803e797bf9cd40
parent28c9a09b30dbc63dbcd4a1e44177c8f7cf523687 (diff)
downloadeclipse.platform.team-549de2058ecca62651f2d2003bc16a37cda523d7.tar.gz
eclipse.platform.team-549de2058ecca62651f2d2003bc16a37cda523d7.tar.xz
eclipse.platform.team-549de2058ecca62651f2d2003bc16a37cda523d7.zip
Bug 55938 [Sync View] NPE changing sync view layout
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberParticipantPage.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/StructuredViewerAdvisor.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TreeViewerAdvisor.java1
3 files changed, 9 insertions, 3 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberParticipantPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberParticipantPage.java
index 8a2ba2327..b6e587d71 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberParticipantPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SubscriberParticipantPage.java
@@ -176,7 +176,6 @@ public final class SubscriberParticipantPage implements IPageBookViewPage, IProp
public void dispose() {
statusLine.dispose();
changesSection.dispose();
- viewerAdvisor.dispose();
TeamUIPlugin.getPlugin().getPreferenceStore().removePropertyChangeListener(this);
participant.removePropertyChangeListener(this);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/StructuredViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/StructuredViewerAdvisor.java
index a5f7abf89..ca771f711 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/StructuredViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/StructuredViewerAdvisor.java
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.action.*;
import org.eclipse.jface.util.ListenerList;
import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.events.*;
import org.eclipse.swt.events.MenuEvent;
import org.eclipse.swt.events.MenuListener;
import org.eclipse.swt.widgets.Control;
@@ -86,8 +87,8 @@ public abstract class StructuredViewerAdvisor {
/**
* Create an advisor that will allow viewer contributions with the given <code>targetID</code>. This
- * advisor will provide a presentation model based on the given sync info set. Note that it's important
- * to call {@link #dispose()} when finished with an advisor.
+ * advisor will provide a presentation model based on the given sync info set. The model is disposed
+ * when the viewer is disposed.
*
* @param targetID the targetID defined in the viewer contributions in a plugin.xml file.
* @param site the workbench site with which to register the menuId. Can be <code>null</code> in which
@@ -307,6 +308,11 @@ public abstract class StructuredViewerAdvisor {
* @param viewer the viewer being initialize
*/
protected void initializeListeners(final StructuredViewer viewer) {
+ viewer.getControl().addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ StructuredViewerAdvisor.this.dispose();
+ }
+ });
}
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TreeViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TreeViewerAdvisor.java
index 9bd4b2422..8fb2326b8 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TreeViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TreeViewerAdvisor.java
@@ -205,6 +205,7 @@ public class TreeViewerAdvisor extends StructuredViewerAdvisor implements IPrope
* @see org.eclipse.team.ui.synchronize.viewers.StructuredViewerAdvisor#initializeListeners(org.eclipse.jface.viewers.StructuredViewer)
*/
protected void initializeListeners(StructuredViewer viewer) {
+ super.initializeListeners(viewer);
viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
handleDoubleClick(getViewer(), event);

Back to the top