Skip to content

Commit

Permalink
use org.eclipse.core.runtime.Platform instead of System to retrieve os
Browse files Browse the repository at this point in the history
  • Loading branch information
mierin12 committed Nov 21, 2024
1 parent f7e4cd3 commit 2b6be85
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 2b6be85

Please sign in to comment.