Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-11-24 16:12:16 -0500
committerJean Michel-Lemieux2003-11-24 16:12:16 -0500
commite893fe69ed514ec801d7147a68af2d4ddb0c5e61 (patch)
treeeed48ed1fb03ccfa4f4c067b335043d110d611bf
parent951b2573db62ddd77215f800cb37b154075ef772 (diff)
downloadeclipse.platform.team-e893fe69ed514ec801d7147a68af2d4ddb0c5e61.tar.gz
eclipse.platform.team-e893fe69ed514ec801d7147a68af2d4ddb0c5e61.tar.xz
eclipse.platform.team-e893fe69ed514ec801d7147a68af2d4ddb0c5e61.zip
Bug 47158 NPE in SyncSetContentProvider
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java
index e2ace743a..b8bc59c7d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewPage.java
@@ -16,6 +16,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.widgets.Composite;
import org.eclipse.team.internal.ccvs.ui.CVSLightweightDecorator;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ui.synchronize.sets.*;
@@ -50,10 +51,8 @@ public class CVSSynchronizeViewPage extends TeamSubscriberParticipantPage implem
public CVSSynchronizeViewPage(TeamSubscriberParticipant page, ISynchronizeView view, SubscriberInput input) {
super(page, view, input);
- getInput().getFilteredSyncSet().addSyncSetChangedListener(this);
- CVSUIPlugin.addPropertyChangeListener(this);
- }
-
+ }
+
/*
* (non-Javadoc)
*
@@ -72,7 +71,7 @@ public class CVSSynchronizeViewPage extends TeamSubscriberParticipantPage implem
*/
public void syncSetChanged(SyncSetChangedEvent event) {
StructuredViewer viewer = getViewer();
- if (viewer != null) {
+ if (viewer != null && getInput() != null) {
IStructuredContentProvider cp = (IStructuredContentProvider) viewer.getContentProvider();
StructuredSelection selection = new StructuredSelection(cp.getElements(getInput()));
for (Iterator it = delegates.iterator(); it.hasNext(); ) {
@@ -119,8 +118,17 @@ public class CVSSynchronizeViewPage extends TeamSubscriberParticipantPage implem
public void propertyChange(PropertyChangeEvent event) {
super.propertyChange(event);
String prop = event.getProperty();
- if(prop.equals(CVSUIPlugin.P_DECORATORS_CHANGED)) {
+ if(prop.equals(CVSUIPlugin.P_DECORATORS_CHANGED) && getViewer() != null && getInput() != null) {
getViewer().refresh(true /* update labels */);
}
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.IPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ getInput().getFilteredSyncSet().addSyncSetChangedListener(this);
+ CVSUIPlugin.addPropertyChangeListener(this);
+ }
} \ No newline at end of file

Back to the top