mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 10:15:39 +02:00
Fix for 176871: InvalidThreadAccess in CElementLabelProvider
This commit is contained in:
parent
01274ff514
commit
5cb6f4c74c
1 changed files with 4 additions and 1 deletions
|
@ -21,6 +21,7 @@ import org.eclipse.jface.viewers.LabelProvider;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.graphics.Color;
|
import org.eclipse.swt.graphics.Color;
|
||||||
import org.eclipse.swt.graphics.Image;
|
import org.eclipse.swt.graphics.Image;
|
||||||
|
import org.eclipse.swt.widgets.Display;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.IInclude;
|
import org.eclipse.cdt.core.model.IInclude;
|
||||||
import org.eclipse.cdt.ui.CUIPlugin;
|
import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
|
@ -54,7 +55,6 @@ public class CUILabelProvider extends LabelProvider implements IColorProvider {
|
||||||
fStorageLabelProvider= new StorageLabelProvider();
|
fStorageLabelProvider= new StorageLabelProvider();
|
||||||
fImageFlags= imageFlags;
|
fImageFlags= imageFlags;
|
||||||
fTextFlags= textFlags;
|
fTextFlags= textFlags;
|
||||||
fInactiveColor= CUIPlugin.getStandardDisplay().getSystemColor(SWT.COLOR_DARK_GRAY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -230,6 +230,9 @@ public class CUILabelProvider extends LabelProvider implements IColorProvider {
|
||||||
if (element instanceof IInclude) {
|
if (element instanceof IInclude) {
|
||||||
IInclude include= (IInclude)element;
|
IInclude include= (IInclude)element;
|
||||||
if (!include.isActive()) {
|
if (!include.isActive()) {
|
||||||
|
if (fInactiveColor == null && Display.getCurrent() != null) {
|
||||||
|
fInactiveColor= CUIPlugin.getStandardDisplay().getSystemColor(SWT.COLOR_DARK_GRAY);
|
||||||
|
}
|
||||||
return fInactiveColor;
|
return fInactiveColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue