Bug 27864 - Load of CompareUI fails when not triggered in UI thread
Summary: Load of CompareUI fails when not triggered in UI thread
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Platform-Compare-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-06 14:55 EST by Boris Pruessmann CLA
Modified: 2002-12-23 03:58 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Pruessmann CLA 2002-12-06 14:55:20 EST
Writing an action that uses the CompareUI, I get the following exception.

Caused by: org.eclipse.swt.SWTException: Invalid thread access
	at org.eclipse.swt.SWT.error(SWT.java:2139)
	at org.eclipse.swt.SWT.error(SWT.java:2071)
	at org.eclipse.swt.widgets.Display.error(Display.java:529)
	at org.eclipse.swt.widgets.Display.checkDevice(Display.java:397)
	at org.eclipse.swt.widgets.Display.getSystemColor(Display.java:1048)
	at org.eclipse.compare.internal.ComparePreferencePage.initDefaults
(ComparePreferencePage.java:95)
	at 
org.eclipse.compare.internal.CompareUIPlugin.initializeDefaultPreferences
(CompareUIPlugin.java:127)
	at 
org.eclipse.ui.plugin.AbstractUIPlugin.initializeDefaultPluginPreferences
(AbstractUIPlugin.java:624)
	at org.eclipse.core.runtime.Plugin.getPluginPreferences(Plugin.java:347)
	at 
org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.initialize
(AbstractUIPlugin.java:180)
	at org.eclipse.ui.plugin.AbstractUIPlugin.getPreferenceStore
(AbstractUIPlugin.java:561)
	at org.eclipse.compare.internal.CompareUIPlugin.initPreferenceStore
(CompareUIPlugin.java:788)
	at org.eclipse.compare.internal.CompareUIPlugin.<init>
(CompareUIPlugin.java:118)

My action does not run in the display thread and uses Display.asyncExec() to 
open the CompareUI. However, the CompareUI component's load is triggered when 
the referencing class is loaded at that happens outside the UI thread. 

If I used Eclipse's compare actions before, thus triggering the load of the 
component, everything works as expected.
Comment 1 Andre Weinand CLA 2002-12-23 03:58:45 EST
fixed and released  on 20021223