From ae7a4088336cad3329e95f71b536859fab01768f Mon Sep 17 00:00:00 2001 From: mierin12 Date: Thu, 21 Nov 2024 20:49:41 +0100 Subject: [PATCH] use org.eclipse.core.runtime.Platform instead of System to retrieve os --- .../portfolio/ui/util/chart/TimelineChartToolTip.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/util/chart/TimelineChartToolTip.java b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/util/chart/TimelineChartToolTip.java index 0bdadbd222..990fa79950 100644 --- a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/util/chart/TimelineChartToolTip.java +++ b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/util/chart/TimelineChartToolTip.java @@ -15,6 +15,7 @@ import java.util.function.BiConsumer; import java.util.function.Function; +import org.eclipse.core.runtime.Platform; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.jface.resource.FontDescriptor; @@ -228,10 +229,8 @@ protected void createComposite(Composite parent) extraInfoProvider.forEach(provider -> provider.accept(container, focus)); Label hint = new Label(data, SWT.WRAP); - String os = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$ - String pressAltOrOption = os.startsWith("mac") ? "Option" : "Alt"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - hint.setText(MessageFormat.format(Messages.TooltipHintPressAlt, pressAltOrOption)); - + hint.setText(MessageFormat.format(Messages.TooltipHintPressAlt, + Platform.OS_MACOSX.equals(Platform.getOS()) ? "Option" : "Alt")); //$NON-NLS-1$ //$NON-NLS-2$ // first set a small width and then update later GridData hintData = GridDataFactory.fillDefaults().span(2, 1).hint(10, SWT.DEFAULT).span(2, 1).create(); hint.setLayoutData(hintData);