Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-04-15 14:44:08 +0000
committerJean Michel-Lemieux2004-04-15 14:44:08 +0000
commitcd74248f5558aa0ad3748dff05c8b6d094cdc341 (patch)
tree9b5cc3718ce554963f36fac0e4489f0c1fbbc344
parentfd4d11b329c44bb5f018cbb217c4c00c8f2c56f8 (diff)
downloadeclipse.platform.team-cd74248f5558aa0ad3748dff05c8b6d094cdc341.tar.gz
eclipse.platform.team-cd74248f5558aa0ad3748dff05c8b6d094cdc341.tar.xz
eclipse.platform.team-cd74248f5558aa0ad3748dff05c8b6d094cdc341.zip
Use the correct shell.
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkbenchUserAuthenticator.java25
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java11
2 files changed, 6 insertions, 30 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkbenchUserAuthenticator.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkbenchUserAuthenticator.java
index 4137a026d..c5e35add1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkbenchUserAuthenticator.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkbenchUserAuthenticator.java
@@ -17,8 +17,7 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.*;
import org.eclipse.team.internal.ccvs.core.*;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.team.internal.ui.Utils;
/**
* An authenticator that prompts the user for authentication info,
@@ -105,7 +104,7 @@ public class WorkbenchUserAuthenticator implements IUserAuthenticator {
* @param result a String array of length two in which to put the result
*/
private boolean promptForPassword(final ICVSRepositoryLocation location, final String username, final String message, final boolean userMutable, final String[] result) {
- Shell shell = getShell();
+ Shell shell = Utils.findShell();
if(shell == null) {
return false;
}
@@ -158,7 +157,7 @@ public class WorkbenchUserAuthenticator implements IUserAuthenticator {
final String[] prompt,
final boolean[] echo) {
- Shell shell = getShell();
+ Shell shell = Utils.findShell();
if(shell == null) return new String[0];
String domain = location == null ? null : location.getLocation();
KeyboardInteractiveDialog dialog = new KeyboardInteractiveDialog(shell,
@@ -176,10 +175,7 @@ public class WorkbenchUserAuthenticator implements IUserAuthenticator {
* Special alternate prompting. Returns the password. Username must be fixed.
*/
private String alternatePromptForPassword(final String username) {
- Shell shell = getShell();
- if(shell == null) {
- return null;
- }
+ Shell shell = Utils.findShell();
AlternateUserValidationDialog dialog = new AlternateUserValidationDialog(shell, (username == null) ? "" : username); //$NON-NLS-1$
dialog.setUsername(username);
int result = dialog.open();
@@ -245,17 +241,4 @@ public class WorkbenchUserAuthenticator implements IUserAuthenticator {
});
return retval[0];
}
-
- private Shell getShell( ) {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if(window != null) {
- return window.getShell();
- }
- Display display= Display.getCurrent();
- if (display == null) {
- display= Display.getDefault();
- return display.getActiveShell();
- }
- return null;
- }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
index cc96b16cb..cf3d7ea7b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
@@ -19,7 +19,7 @@ import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.subscriber.MergeSynchronizeParticipant;
-import org.eclipse.ui.*;
+import org.eclipse.team.internal.ui.Utils;
public class MergeWizard extends Wizard {
MergeWizardStartPage startPage;
@@ -46,19 +46,12 @@ public class MergeWizard extends Wizard {
* @see IWizard#performFinish()
*/
public boolean performFinish() {
-
- IWorkbenchWindow wWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage activePage = null;
- if(wWindow != null) {
- activePage = wWindow.getActivePage();
- }
-
CVSTag startTag = startPage.getTag();
CVSTag endTag = endPage.getTag();
CVSMergeSubscriber s = new CVSMergeSubscriber(resources, startTag, endTag);
MergeSynchronizeParticipant participant = new MergeSynchronizeParticipant(s);
- participant.refreshInDialog(wWindow.getShell(), s.roots(), Policy.bind("Participant.merging"), CVSMergeSubscriber.ID_MODAL, participant.getSubscriberSyncInfoCollector().getSyncInfoTree(), null); //$NON-NLS-1$
+ participant.refreshInDialog(Utils.findShell(), s.roots(), Policy.bind("Participant.merging"), CVSMergeSubscriber.ID_MODAL, participant.getSubscriberSyncInfoCollector().getSyncInfoTree(), null); //$NON-NLS-1$
return true;
}

Back to the top