Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-03-29 20:42:05 -0500
committerJean Michel-Lemieux2004-03-29 20:42:05 -0500
commitf9b84a4548460c80cea7e23814668ff632ccead6 (patch)
treee76acea0aa934c656a0e674e71cfe37035e22af2
parentfd2ef53774bc0954805bb64584cc8d3982500e8c (diff)
downloadeclipse.platform.team-branch_20040226_participantLifecycle.tar.gz
eclipse.platform.team-branch_20040226_participantLifecycle.tar.xz
eclipse.platform.team-branch_20040226_participantLifecycle.zip
*** empty log message ***branch_20040226_participantLifecycle
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardSyncPage.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicyInModalDialog.java23
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java2
5 files changed, 25 insertions, 15 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
index b1d106802..620d0e41e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
@@ -29,11 +29,11 @@ import org.eclipse.team.ui.synchronize.ISynchronizeParticipantReference;
public class SyncAction extends WorkspaceAction {
public void execute(IAction action) throws InvocationTargetException {
+ ISynchronizeParticipantReference ref = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant();
try {
IResource[] resources = getResourcesToSync();
if (resources == null || resources.length == 0)
- return;
- ISynchronizeParticipantReference ref = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant();
+ return;
if (ref != null) {
ISynchronizeParticipant participant = ref.createParticipant();
IWizard wizard = participant.createSynchronizeWizard();
@@ -43,6 +43,8 @@ public class SyncAction extends WorkspaceAction {
}
} catch (TeamException e) {
throw new InvocationTargetException(e);
+ } finally {
+ ref.releaseParticipant();
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardSyncPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardSyncPage.java
index 6f20de3ff..69eafc38c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardSyncPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardSyncPage.java
@@ -148,7 +148,7 @@ public class SharingWizardSyncPage extends CVSWizardPage implements ISyncInfoSet
collector.start(new NullProgressMonitor());
TreeViewerAdvisor advisor = new SharingWizardTreeAdviser(participant.getId(), null, infos);
CompareConfiguration cc = new CompareConfiguration();
- SynchronizeCompareInput input = new SynchronizeCompareInput(cc, advisor) {
+ input = new SynchronizeCompareInput(cc, advisor) {
public String getTitle() {
return Policy.bind("SharingWizardSyncPage.0"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicyInModalDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicyInModalDialog.java
index d609f0dc4..2fe6ed5d7 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicyInModalDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicyInModalDialog.java
@@ -51,18 +51,21 @@ public class RefreshUserNotificationPolicyInModalDialog implements IRefreshSubsc
// Operation cancelled, there is no reason to prompt the user
TeamUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
public void run() {
- if (event.getStatus().isOK()) {
- if (!areChanges()) {
- MessageDialog.openInformation(Display.getCurrent().getActiveShell(), Policy.bind("OpenComparedDialog.noChangeTitle"), Policy.bind("OpenComparedDialog.noChangesMessage")); //$NON-NLS-1$ //$NON-NLS-2$
- return;
- }
- if (isSingleFileCompare(event.getResources())) {
- compareAndOpenEditors(event, participant);
- } else {
- compareAndOpenDialog(event, participant);
+ try {
+ if (event.getStatus().isOK()) {
+ if (!areChanges()) {
+ MessageDialog.openInformation(Display.getCurrent().getActiveShell(), Policy.bind("OpenComparedDialog.noChangeTitle"), Policy.bind("OpenComparedDialog.noChangesMessage")); //$NON-NLS-1$ //$NON-NLS-2$
+ return;
+ }
+ if (isSingleFileCompare(event.getResources())) {
+ compareAndOpenEditors(event, participant);
+ } else {
+ compareAndOpenDialog(event, participant);
+ }
}
+ } finally {
+ ref.releaseParticipant();
}
- ref.releaseParticipant();
}
});
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
index c31b59ac1..438ecd215 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
@@ -191,7 +191,8 @@ public class SynchronizeManager implements ISynchronizeManager {
if (count <= 0) {
saveState();
ref.dispose();
- }
+ }
+ System.out.println("** release called " + getId() + ":" + count);
}
/* (non-Javadoc)
@@ -200,13 +201,15 @@ public class SynchronizeManager implements ISynchronizeManager {
public ISynchronizeParticipant createParticipant() throws TeamException {
String key = getKey(descriptor.getId(), getSecondaryId());
ISynchronizeParticipant participant = (ISynchronizeParticipant) counter.get(key);
+ int refCount = 1;
if (participant == null) {
participant = instantiate();
if(participant != null)
counter.put(key, participant);
} else {
- counter.addRef(key);
+ refCount = counter.addRef(key);
}
+ System.out.println("** create called " + getId() + ":" + refCount);
return participant;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java
index 9016ab7d2..0384154fd 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/GlobalRefreshAction.java
@@ -168,6 +168,8 @@ public class GlobalRefreshAction extends Action implements IMenuCreator, IWorkbe
updateTooltipMessage();
} catch (TeamException e) {
Utils.handle(e);
+ } finally {
+ ref.releaseParticipant();
}
}

Back to the top