Skip to content

Commit c38a43d

Browse files
committed
Improve display of multi-line single String launch validation errors
mainly on Windows. Follow-up on - #2055
1 parent e0822fe commit c38a43d

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/JUnitLaunchValidationOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private void checkJunitVersion(ILaunchConfiguration configuration, Set<IPluginMo
7575
}
7676

7777
private void addError(String message) {
78-
fErrors.put(message.replaceAll("\\R", " "), null); //$NON-NLS-1$//$NON-NLS-2$
78+
fErrors.put(message, null);
7979
}
8080

8181
@Override

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PluginStatusDialog.java

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package org.eclipse.pde.internal.ui.launcher;
1717

1818
import java.util.Map;
19+
import java.util.Map.Entry;
1920

2021
import org.eclipse.core.runtime.MultiStatus;
2122
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -44,6 +45,7 @@
4445
import org.eclipse.swt.widgets.Label;
4546
import org.eclipse.swt.widgets.Link;
4647
import org.eclipse.swt.widgets.Shell;
48+
import org.eclipse.swt.widgets.Text;
4749
import org.eclipse.ui.PlatformUI;
4850

4951
/**
@@ -186,13 +188,21 @@ protected Control createDialogArea(Composite parent) {
186188
Label label = new Label(container, SWT.NONE);
187189
label.setText(PDEUIMessages.PluginStatusDialog_label);
188190

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-
191+
Entry<?, ?> onlyEntry = fInput.size() == 1 ? fInput.entrySet().iterator().next() : null;
192+
if (onlyEntry != null && onlyEntry.getKey() instanceof String errorMessage && errorMessage.contains("\n") //$NON-NLS-1$
193+
&& onlyEntry.getValue() == null) {
194+
// TODO: or Label message = new Label(container, SWT.NONE);
195+
Text message = new Text(container, SWT.MULTI | SWT.READ_ONLY | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
196+
message.setText(errorMessage);
197+
message.setLayoutData(new GridData(GridData.FILL_BOTH));
198+
} else {
199+
treeViewer = new TreeViewer(container);
200+
treeViewer.setContentProvider(new ContentProvider());
201+
treeViewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider());
202+
treeViewer.setComparator(new ViewerComparator());
203+
treeViewer.setInput(fInput);
204+
treeViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
205+
}
196206
getShell().setText(PDEUIMessages.PluginStatusDialog_pluginValidation);
197207
Dialog.applyDialogFont(container);
198208
return container;

0 commit comments

Comments
 (0)