diff options
author | Pascal Rapicault | 2014-11-04 21:43:27 +0000 |
---|---|---|
committer | Pascal Rapicault | 2014-11-04 21:43:27 +0000 |
commit | 5eaa208019d3f5399d371f53e7662edc89e5b0e3 (patch) | |
tree | 9714e81618a109b87967b0a903c4bf292251ed68 /bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2 | |
parent | e3cb43a3e2b4862b9a02aad6664fa54c564e0b1b (diff) | |
download | rt.equinox.p2-5eaa208019d3f5399d371f53e7662edc89e5b0e3.tar.gz rt.equinox.p2-5eaa208019d3f5399d371f53e7662edc89e5b0e3.tar.xz rt.equinox.p2-5eaa208019d3f5399d371f53e7662edc89e5b0e3.zip |
Add support to open information dialog
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ValidationDialogServiceUI.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ValidationDialogServiceUI.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ValidationDialogServiceUI.java index ff6209f26..2994b7f0e 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ValidationDialogServiceUI.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ValidationDialogServiceUI.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 IBM Corporation and others. + * Copyright (c) 2008, 2014 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Rapicorp, Inc. - add support for information dialog *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui; @@ -18,8 +19,7 @@ import org.eclipse.equinox.internal.p2.ui.dialogs.UserValidationDialog; import org.eclipse.equinox.internal.p2.ui.viewers.CertificateLabelProvider; import org.eclipse.equinox.p2.core.UIServices; import org.eclipse.equinox.p2.ui.LoadMetadataRepositoryJob; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.*; import org.eclipse.jface.viewers.*; import org.eclipse.jface.window.Window; import org.eclipse.osgi.util.NLS; @@ -160,7 +160,6 @@ public class ValidationDialogServiceUI extends UIServices { } public AuthenticationInfo getUsernamePassword(final String location, final AuthenticationInfo previousInfo) { - final AuthenticationInfo[] result = new AuthenticationInfo[1]; if (!suppressAuthentication() && !isHeadless()) { PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { @@ -186,6 +185,18 @@ public class ValidationDialogServiceUI extends UIServices { return result[0]; } + public void showInformationMessage(final String title, final String text) { + if (isHeadless()) { + super.showInformationMessage(title, text); + return; + } + PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { + public void run() { + MessageDialog.openInformation(ProvUI.getDefaultParentShell(), title, text); + } + }); + } + private boolean isHeadless() { // If there is no UI available and we are still the IServiceUI, // assume that the operation should proceed. See |