Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2019-05-16 06:57:57 +0000
committerAndrey Loskutov2019-05-16 07:55:27 +0000
commit0470f4612faa0ca366c94ccdb40e1bd94bb9618d (patch)
tree25b667abe7af958a3be700d0cf1b7bb260d12aa8
parent8aee01f78b50965a1b3f8a639fb56a042ae22f0c (diff)
downloadeclipse.pde.ui-0470f4612faa0ca366c94ccdb40e1bd94bb9618d.tar.gz
eclipse.pde.ui-0470f4612faa0ca366c94ccdb40e1bd94bb9618d.tar.xz
eclipse.pde.ui-0470f4612faa0ca366c94ccdb40e1bd94bb9618d.zip
If we run build headless, don't try to init or use Display. Change-Id: Ic07968fe22c020ed4bada2d46cd1f99361327660 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ColorManager.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ColorManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ColorManager.java
index b75a389226..5719e5b3c5 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ColorManager.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ColorManager.java
@@ -59,6 +59,9 @@ public class ColorManager implements IColorManager, IPDEColorConstants {
PreferenceConverter.setDefault(store, P_HEADER_ATTRIBUTES, HEADER_ATTRIBUTES);
store.setDefault(P_HEADER_ATTRIBUTES + IPDEColorConstants.P_ITALIC_SUFFIX, true);
PreferenceConverter.setDefault(store, P_HEADER_ASSIGNMENT, HEADER_ASSIGNMENT);
+ if (!PlatformUI.isWorkbenchRunning()) {
+ return;
+ }
try {
Display display = PlatformUI.getWorkbench().getDisplay();
Runnable runnable = () -> {
@@ -73,7 +76,8 @@ public class ColorManager implements IColorManager, IPDEColorConstants {
} else {
display.asyncExec(runnable);
}
- } catch (SWTException e) { // keep non-high-contrast-mode defaults
+ } catch (SWTException | IllegalStateException e) {
+ // keep non-high-contrast-mode defaults
}
}

Back to the top