diff options
author | Michael Valenta | 2006-04-28 15:01:39 +0000 |
---|---|---|
committer | Michael Valenta | 2006-04-28 15:01:39 +0000 |
commit | dfb760255aee33db56cccd70aaf032b7f01795ed (patch) | |
tree | 85c845c1aec12c3b07fcfc06926c44612eab0c89 | |
parent | 0c70ec9080cbce5baa0d6eafd9bb92b0db0c6528 (diff) | |
download | eclipse.platform.team-dfb760255aee33db56cccd70aaf032b7f01795ed.tar.gz eclipse.platform.team-dfb760255aee33db56cccd70aaf032b7f01795ed.tar.xz eclipse.platform.team-dfb760255aee33db56cccd70aaf032b7f01795ed.zip |
Bug 139157 Promoted twice to switch to sync perspective
4 files changed, 30 insertions, 6 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshEvent.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshEvent.java index f8eff84a3..8177022dc 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshEvent.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshEvent.java @@ -91,9 +91,21 @@ public interface IRefreshEvent { /** * Returns the status of the refresh operation. This can be used to determine if the - * refresh completed successfuly, with an error, or was cancelled. + * refresh completed successfully, with an error, or was canceled. * * @return the status of the refresh operation. */ public IStatus getStatus(); + + /** + * Set whether this event is being presented in a progress view link + * @param isLink + */ + public void setIsLink(boolean isLink); + + /** + * Return whether this event is being displayed in a link. + * @return whether this event is being displayed in a link + */ + public boolean isLink(); } diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshEvent.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshEvent.java index 5dc4b338a..4badfdc89 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshEvent.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshEvent.java @@ -26,6 +26,7 @@ public class RefreshEvent implements IRefreshEvent { IStatus status; private final ISynchronizeParticipant participant; private final IChangeDescription description; + private boolean isLink; public RefreshEvent(int type, ISynchronizeParticipant participant, IChangeDescription description) { this.type = type; @@ -68,4 +69,12 @@ public class RefreshEvent implements IRefreshEvent { public IChangeDescription getChangeDescription() { return description; } + + public boolean isLink() { + return isLink; + } + + public void setIsLink(boolean isLink) { + this.isLink = isLink; + } } diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshParticipantJob.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshParticipantJob.java index c65bdea97..d97c34e55 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshParticipantJob.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshParticipantJob.java @@ -427,6 +427,7 @@ public abstract class RefreshParticipantJob extends Job { public ActionFactory.IWorkbenchAction refreshDone(IRefreshEvent event) { if(listener != null) { boolean isModal = isJobModal(); + event.setIsLink(!isModal); final ActionFactory.IWorkbenchAction runnable = listener.refreshDone(event); if(runnable != null) { // If the job is being run modally then simply prompt the user immediately diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicy.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicy.java index e20d140f2..0b848fce7 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicy.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshUserNotificationPolicy.java @@ -60,7 +60,7 @@ public class RefreshUserNotificationPolicy implements IRefreshSubscriberListener public ActionFactory.IWorkbenchAction refreshDone(final IRefreshEvent event) { // Ensure that this event was generated for this participant if (event.getParticipant() != participant) return null; - // If the event is for a cancelled operation, there's nothing to do + // If the event is for a canceled operation, there's nothing to do int severity = event.getStatus().getSeverity(); if(severity == IStatus.CANCEL || severity == IStatus.ERROR) return null; // Decide on what action to take after the refresh is completed @@ -75,10 +75,12 @@ public class RefreshUserNotificationPolicy implements IRefreshSubscriberListener notifyIfNeededModal(event); } setToolTipText(getToolTipText()); - // Go to the sync view - ISynchronizeView view = TeamUI.getSynchronizeManager().showSynchronizeViewInActivePage(); - if (view != null) { - view.display(participant); + if (event.isLink()) { + // Go to the sync view + ISynchronizeView view = TeamUI.getSynchronizeManager().showSynchronizeViewInActivePage(); + if (view != null) { + view.display(participant); + } } } |