Skip to content

Commit

Permalink
Move workbench running check in ColorManager to prevent SWT errors wh…
Browse files Browse the repository at this point in the history
…en headless

This change adjusts the check added for Eclipze bugzilla 546205 ticket.
The check for running workbench is now done at the start of ColorManager.initializeDefaults(),
to prevent the creation of an SWT Display object when in headless mode.

See: https://bugs.eclipse.org/bugs//show_bug.cgi?id=546205

Fixes: #1486
  • Loading branch information
Simeon Andreev authored and Simeon Andreev committed Nov 19, 2024
1 parent f16299a commit c3adf9e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public static IColorManager getDefault() {
}

public static void initializeDefaults(IPreferenceStore store) {
if (!PlatformUI.isWorkbenchRunning()) {
return;
}
PreferenceConverter.setDefault(store, P_DEFAULT, DEFAULT);
PreferenceConverter.setDefault(store, P_PROC_INSTR, PROC_INSTR);
PreferenceConverter.setDefault(store, P_STRING, STRING);
Expand All @@ -61,9 +64,6 @@ public static void initializeDefaults(IPreferenceStore store) {
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 = () -> {
Expand Down

0 comments on commit c3adf9e

Please sign in to comment.