Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-02-05 18:48:51 +0000
committerMichael Valenta2003-02-05 18:48:51 +0000
commit03d9c8908c8f9f2c0df5267d00dcc99b2eaf254d (patch)
tree52c7020ad4f75210528fe2fc207104539b6d3606
parente0f4bfc4cd0d046a596208338381def899cce5bc (diff)
downloadeclipse.platform.team-03d9c8908c8f9f2c0df5267d00dcc99b2eaf254d.tar.gz
eclipse.platform.team-03d9c8908c8f9f2c0df5267d00dcc99b2eaf254d.tar.xz
eclipse.platform.team-03d9c8908c8f9f2c0df5267d00dcc99b2eaf254d.zip
30988: NPE when clicking on Team Synchronize action in toolbar
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAllAction.java13
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java1
2 files changed, 14 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAllAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAllAction.java
index 6f5e0aba5..b72ae2e5a 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAllAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAllAction.java
@@ -23,6 +23,7 @@ import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.ui.AdaptableResourceList;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.ProjectSelectionDialog;
+import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.model.WorkbenchContentProvider;
@@ -32,6 +33,9 @@ import org.eclipse.ui.model.WorkbenchLabelProvider;
* Synchronize all CVS projects.
*/
public class SyncAllAction extends SyncAction implements IWorkbenchWindowActionDelegate {
+
+ private IWorkbenchWindow window;
+
/**
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
*/
@@ -42,6 +46,7 @@ public class SyncAllAction extends SyncAction implements IWorkbenchWindowActionD
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
*/
public void init(IWorkbenchWindow window) {
+ this.window = window;
this.shell = window.getShell();
}
@@ -96,4 +101,12 @@ public class SyncAllAction extends SyncAction implements IWorkbenchWindowActionD
return new IResource[0];
}
+ /**
+ * @see org.eclipse.team.internal.ui.actions.TeamAction#getTargetPage()
+ */
+ protected IWorkbenchPage getTargetPage() {
+ if (window == null) return super.getTargetPage();
+ return window.getActivePage();
+ }
+
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java
index 74b1f6363..bf99c9e1e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java
@@ -367,6 +367,7 @@ public abstract class TeamAction extends ActionDelegate implements IObjectAction
* @return IWorkbenchPage
*/
protected IWorkbenchPage getTargetPage() {
+ if (getTargetPart() == null) return TeamUIPlugin.getActivePage();
return getTargetPart().getSite().getPage();
}

Back to the top