Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » PreferenceConverter throws Exception
PreferenceConverter throws Exception [message #462031] Mon, 22 January 2007 14:47
Eclipse UserFriend
Originally posted by: florianwendland.freenet.de

Hello all,

I have read both articles about Preferences on eclipse.org. Now, I want
to create some Preferences for my standalone rcp app, String values also
as Color values.

Therefore, I use the PreferenceConverter class. I call in
PreferenceInitializer

###############################MYSNIPPET#################### ##########################
final IPreferenceStore store =
Activator.getDefault().getPreferenceStore();
PreferenceConverter.setDefault(store,
PreferenceConstants.PREF_EDITOR_FOREGROUND, new RGB(255,0,0));
############################################################ ##########################

but an exception is thrown. Here is the stack trace:

################################STACKTRACE################## ##########################
!SESSION 2007-01-22 15:31:14.156
-----------------------------------------------
eclipse.buildId=unknown
java.version=1.5.0_10
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE


!ENTRY org.eclipse.osgi 4 0 2007-01-22 15:31:16.031
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:3374)
at org.eclipse.swt.SWT.error(SWT.java:3297)
at org.eclipse.swt.SWT.error(SWT.java:3268)
at org.eclipse.swt.widgets.Display.checkDisplay(Display.java:64 6)
at org.eclipse.swt.widgets.Display.create(Display.java:707)
at org.eclipse.swt.graphics.Device.<init>(Device.java:129)
at org.eclipse.swt.widgets.Display.<init>(Display.java:402)
at org.eclipse.swt.widgets.Display.<init>(Display.java:393)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.ja va:448)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
at pingproject.Application.run(Application.java:37)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
############################################################ ##########################


It seems, that the PreferenceConverte causes this exception because on
decomment it, the app starts as usual.

What's wrong with my code? Did i miss something?

Thanks

Florian Wendland
Previous Topic:ScrollBar help in Section
Next Topic:Classloader problems when bundling CGLIB as plugin
Goto Forum:
  


Current Time: Wed Sep 18 05:24:40 GMT 2024

Powered by FUDForum. Page generated in 0.02855 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top