Skip to content

Commit 5ccec01

Browse files
srinibharathmerks
authored andcommitted
providing standard platform check utility
Fixup : Address review comments
1 parent 386fe5a commit 5ccec01

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/FocusCellOwnerDrawHighlighter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.eclipse.jface.viewers;
1818

1919
import org.eclipse.core.runtime.Assert;
20+
import org.eclipse.jface.util.Util;
2021
import org.eclipse.swt.SWT;
2122
import org.eclipse.swt.graphics.Color;
2223
import org.eclipse.swt.graphics.GC;
@@ -106,7 +107,7 @@ private void markFocusedCell(Event event, ViewerCell cell) {
106107

107108
private void removeSelectionInformation(Event event, ViewerCell cell) {
108109
GC gc = event.gc;
109-
if ("gtk".equals(SWT.getPlatform())) { //$NON-NLS-1$
110+
if (Util.isGtk()) {
110111
// On GTK, the line is highlighted even though the SELECTED flag is removed. To
111112
// fix this issue, the background must be overwridden
112113
gc.setBackground(cell.getViewerRow().getBackground(cell.getColumnIndex()));

bundles/org.eclipse.search/search/org/eclipse/search/internal/ui/text/FileLabelProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
import java.util.Arrays;
2020
import java.util.Comparator;
2121

22-
import org.eclipse.swt.SWT;
2322
import org.eclipse.swt.graphics.Image;
2423

2524
import org.eclipse.core.resources.IResource;
2625

26+
import org.eclipse.jface.util.Util;
2727
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
2828
import org.eclipse.jface.viewers.ILabelProviderListener;
2929
import org.eclipse.jface.viewers.LabelProvider;
@@ -186,7 +186,7 @@ private int appendShortenedGap(String content, int start, int end, int charsToCu
186186

187187

188188
private int getCharsToCut(int contentLength, Match[] matches) {
189-
if (contentLength <= 256 || !"win32".equals(SWT.getPlatform()) || matches.length == 0) { //$NON-NLS-1$
189+
if (contentLength <= 256 || !Util.isWin32() || matches.length == 0) {
190190
return 0; // no shortening required
191191
}
192192
// XXX: workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=38519

0 commit comments

Comments
 (0)