|
16 | 16 | package org.eclipse.pde.internal.ui.launcher; |
17 | 17 |
|
18 | 18 | import java.util.Map; |
| 19 | +import java.util.Map.Entry; |
19 | 20 |
|
20 | 21 | import org.eclipse.core.runtime.MultiStatus; |
21 | 22 | import org.eclipse.debug.core.ILaunchConfiguration; |
|
44 | 45 | import org.eclipse.swt.widgets.Label; |
45 | 46 | import org.eclipse.swt.widgets.Link; |
46 | 47 | import org.eclipse.swt.widgets.Shell; |
| 48 | +import org.eclipse.swt.widgets.Text; |
47 | 49 | import org.eclipse.ui.PlatformUI; |
48 | 50 |
|
49 | 51 | /** |
@@ -185,14 +187,23 @@ protected Control createDialogArea(Composite parent) { |
185 | 187 |
|
186 | 188 | Label label = new Label(container, SWT.NONE); |
187 | 189 | label.setText(PDEUIMessages.PluginStatusDialog_label); |
188 | | - |
189 | | - treeViewer = new TreeViewer(container); |
190 | | - treeViewer.setContentProvider(new ContentProvider()); |
191 | | - treeViewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider()); |
192 | | - treeViewer.setComparator(new ViewerComparator()); |
193 | | - treeViewer.setInput(fInput); |
194 | | - treeViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH)); |
195 | | - |
| 190 | + GridData gridData = new GridData(GridData.FILL_BOTH); |
| 191 | + |
| 192 | + Entry<?, ?> onlyEntry = fInput.size() == 1 ? fInput.entrySet().iterator().next() : null; |
| 193 | + if (onlyEntry != null && onlyEntry.getKey() instanceof String errorMessage && errorMessage.contains("\n") //$NON-NLS-1$ |
| 194 | + && onlyEntry.getValue() == null) { |
| 195 | + Text message = new Text(container, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL); |
| 196 | + message.setBackground(container.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND)); |
| 197 | + message.setText(errorMessage); |
| 198 | + message.setLayoutData(gridData); |
| 199 | + } else { |
| 200 | + treeViewer = new TreeViewer(container); |
| 201 | + treeViewer.setContentProvider(new ContentProvider()); |
| 202 | + treeViewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider()); |
| 203 | + treeViewer.setComparator(new ViewerComparator()); |
| 204 | + treeViewer.setInput(fInput); |
| 205 | + treeViewer.getControl().setLayoutData(gridData); |
| 206 | + } |
196 | 207 | getShell().setText(PDEUIMessages.PluginStatusDialog_pluginValidation); |
197 | 208 | Dialog.applyDialogFont(container); |
198 | 209 | return container; |
|
0 commit comments