Skip to content

Commit 40a1e5a

Browse files
committed
[FIXUP ??] Hack in better dialog for Windows
1 parent 4ff90ff commit 40a1e5a

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public class JUnitLaunchValidationOperation extends LaunchValidationOperation {
3737
"org.junit.platform.engine", //$NON-NLS-1$
3838
});
3939

40-
private static final Object[] EMPTY = new Object[0];
4140
private final Map<Object, Object[]> fErrors = new HashMap<>(2);
4241

4342
public JUnitLaunchValidationOperation(ILaunchConfiguration configuration, Set<IPluginModelBase> models) {
@@ -76,7 +75,7 @@ private void checkJunitVersion(ILaunchConfiguration configuration, Set<IPluginMo
7675
}
7776

7877
private void addError(String message) {
79-
fErrors.put(message, EMPTY);
78+
fErrors.put(message, null);
8079
}
8180

8281
@Override

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

Lines changed: 16 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,20 @@ 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 && onlyEntry.getValue() == null) {
193+
// TODO: or Label message = new Label(container, SWT.NONE);
194+
Text message = new Text(container, SWT.MULTI | SWT.READ_ONLY | SWT.BORDER);
195+
message.setText(errorMessage);
196+
message.setLayoutData(new GridData(GridData.FILL_BOTH));
197+
} else {
198+
treeViewer = new TreeViewer(container);
199+
treeViewer.setContentProvider(new ContentProvider());
200+
treeViewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider());
201+
treeViewer.setComparator(new ViewerComparator());
202+
treeViewer.setInput(fInput);
203+
treeViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
204+
}
196205
getShell().setText(PDEUIMessages.PluginStatusDialog_pluginValidation);
197206
Dialog.applyDialogFont(container);
198207
return container;

0 commit comments

Comments
 (0)