|
20 | 20 | package org.eclipse.ui.internal.dialogs; |
21 | 21 |
|
22 | 22 | import static org.eclipse.jface.viewers.LabelProvider.createTextProvider; |
| 23 | +import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter; |
23 | 24 | import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_COLOR_AND_FONT_ID; |
24 | 25 | import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_OS_VERSION; |
25 | 26 | import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_THEME_ASSOCIATION; |
26 | 27 | import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_THEME_ID; |
27 | 28 |
|
| 29 | +import java.awt.Desktop; |
| 30 | +import java.io.IOException; |
| 31 | +import java.net.URI; |
| 32 | +import java.net.URISyntaxException; |
28 | 33 | import java.text.Collator; |
29 | 34 | import java.util.ArrayList; |
30 | 35 | import java.util.HashMap; |
|
77 | 82 | import org.eclipse.swt.widgets.Display; |
78 | 83 | import org.eclipse.swt.widgets.Group; |
79 | 84 | import org.eclipse.swt.widgets.Label; |
| 85 | +import org.eclipse.swt.widgets.Link; |
80 | 86 | import org.eclipse.ui.IWorkbench; |
81 | 87 | import org.eclipse.ui.IWorkbenchPreferenceConstants; |
82 | 88 | import org.eclipse.ui.IWorkbenchPreferencePage; |
@@ -213,16 +219,27 @@ private void createHiDPISettingsGroup(Composite parent) { |
213 | 219 | group.setFont(parent.getFont()); |
214 | 220 | GridLayout layout = new GridLayout(1, false); |
215 | 221 | group.setLayout(layout); |
216 | | - Label infoLabel = new Label(group, SWT.WRAP); |
217 | | - infoLabel.setText(WorkbenchMessages.RescaleAtRuntimeDisclaimer); |
| 222 | + Link infoLabel = new Link(group, SWT.WRAP); |
| 223 | + infoLabel.setText(WorkbenchMessages.RescaleAtRuntimeDisclaimer + System.lineSeparator() + System.lineSeparator() |
| 224 | + + WorkbenchMessages.EdgeBrowserDisclaimer); |
218 | 225 | infoLabel.setLayoutData(GridDataFactory.defaultsFor(infoLabel).create()); |
| 226 | + infoLabel.addSelectionListener(widgetSelectedAdapter(c -> openURL(c.text))); |
| 227 | + |
219 | 228 | createLabel(group, ""); //$NON-NLS-1$ |
220 | 229 |
|
221 | 230 | boolean initialStateRescaleAtRuntime = PrefUtil.getAPIPreferenceStore() |
222 | 231 | .getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME); |
223 | 232 | rescaleAtRuntime = createCheckButton(group, WorkbenchMessages.RescaleAtRuntimeEnabled, initialStateRescaleAtRuntime); |
224 | 233 | } |
225 | 234 |
|
| 235 | + private void openURL(String url) { |
| 236 | + try { |
| 237 | + Desktop.getDesktop().browse(new URI(url)); |
| 238 | + } catch (IOException | URISyntaxException e) { |
| 239 | + WorkbenchPlugin.log(e); |
| 240 | + } |
| 241 | + } |
| 242 | + |
226 | 243 | private void createThemeIndependentComposits(Composite comp) { |
227 | 244 | createUseRoundTabs(comp); |
228 | 245 | createColoredLabelsPref(comp); |
|
0 commit comments