Invalid thread access [message #33141] |
Wed, 25 April 2007 06:34 |
Eclipse User |
|
|
|
Originally posted by: swetha.yahoo.co.in
Hi,
I am developing a Gallery View using nebula gallery widget,
the createPartControl method is,
public void createPartControl(Composite parent)
{
gallery = new Gallery(parent, SWT.V_SCROLL);
);
noGroupRenderer = new NoGroupRenderer();
defaultGalleryItemRenderer = new DefaultGalleryItemRenderer();
(some other code)---------
------
-----------
}
the error is coming at the line
defaultGalleryItemRenderer = new DefaultGalleryItemRenderer();
in DefaultGalleryItemRenderer class the error is at the line,
foregroundColor =
Display.getDefault().getSystemColor(SWT.COLOR_LIST_FOREGROUN D);
public DefaultGalleryItemRenderer() {
foregroundColor =
Display.getDefault().getSystemColor(SWT.COLOR_LIST_FOREGROUN D);
backgroundColor =
Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUN D);
selectionForegroundColor = foregroundColor;
selectionBackgroundColor =
Display.getDefault().getSystemColor(SWT.COLOR_LIST_SELECTION );
// Create drop shadows
createColors();
}
The error is,
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.error(Display.java:978)
at org.eclipse.swt.widgets.Display.checkDevice(Display.java:638 )
at org.eclipse.swt.widgets.Display.getSystemColor(Display.java: 1931)
at
org.eclipse.nebula.widgets.gallery.DefaultGalleryItemRendere r. <init>(DefaultGalleryItemRenderer.java:63)
at
com.sequenom.everest.ui.project.GalleryView.createPartContro l(GalleryView.java:335)
at
org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:332)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:197)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:566)
at
org.eclipse.ui.internal.WorkbenchPage$ActivationList.setActi ve(WorkbenchPage.java:3915)
at
org.eclipse.ui.internal.WorkbenchPage.restoreState(Workbench Page.java:2929)
at
org.eclipse.ui.internal.WorkbenchWindow.restoreState(Workben chWindow.java:1936)
at org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.j ava:2857)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1665)
at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1 650)
at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1529 )
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1473)
at
org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(Wor kbenchConfigur
Please help me in this,
Thanks in advance,
Swetha
|
|
|
Re: Invalid thread access [message #33176 is a reply to message #33141] |
Wed, 25 April 2007 07:40 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Hi,
Well the root cause see seems to be that your createPartControl isn't
executed in the GUI-Thread or better said something is calling
createPartControl() in another thread than the GUI is running in. Could
you try simply calling:
public void createPartControl(Composite parent) {
Display.getDefault().getSystemColor(SWT.COLOR_LIST_FOREGROUN D);
}
If this also produces an exception please log a bug against platform-ui.
The nebula-code is not the culprit here I think although I have only
looked at the parts you presented here.
Tom
Swetha schrieb:
> Hi,
>
> I am developing a Gallery View using nebula gallery widget,
> the createPartControl method is,
>
> public void createPartControl(Composite parent)
> {
>
> gallery = new Gallery(parent, SWT.V_SCROLL);
> );
> noGroupRenderer = new NoGroupRenderer();
> defaultGalleryItemRenderer = new DefaultGalleryItemRenderer();
>
> (some other code)---------
> ------
> -----------
> }
>
> the error is coming at the line defaultGalleryItemRenderer = new
> DefaultGalleryItemRenderer();
>
> in DefaultGalleryItemRenderer class the error is at the line,
> foregroundColor =
> Display.getDefault().getSystemColor(SWT.COLOR_LIST_FOREGROUN D);
>
> public DefaultGalleryItemRenderer() {
> foregroundColor =
> Display.getDefault().getSystemColor(SWT.COLOR_LIST_FOREGROUN D);
> backgroundColor =
> Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUN D);
> selectionForegroundColor = foregroundColor;
> selectionBackgroundColor =
> Display.getDefault().getSystemColor(SWT.COLOR_LIST_SELECTION );
>
> // Create drop shadows
> createColors();
> }
>
>
> The error is,
>
> 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.error(Display.java:978)
> at org.eclipse.swt.widgets.Display.checkDevice(Display.java:638 )
> at org.eclipse.swt.widgets.Display.getSystemColor(Display.java: 1931)
> at
> org.eclipse.nebula.widgets.gallery.DefaultGalleryItemRendere r. <init>(DefaultGalleryItemRenderer.java:63)
>
> at
> com.sequenom.everest.ui.project.GalleryView.createPartContro l(GalleryView.java:335)
>
> at
> org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:332)
>
> at org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:197)
> at
> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:566)
>
> at
> org.eclipse.ui.internal.WorkbenchPage$ActivationList.setActi ve(WorkbenchPage.java:3915)
>
> at
> org.eclipse.ui.internal.WorkbenchPage.restoreState(Workbench Page.java:2929)
> at
> org.eclipse.ui.internal.WorkbenchWindow.restoreState(Workben chWindow.java:1936)
>
> at org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.j ava:2857)
> at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1665)
> at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1 650)
> at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1529 )
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1473)
> at
> org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(Wor kbenchConfigur
>
>
> Please help me in this,
>
> Thanks in advance,
> Swetha
>
>
>
|
|
|
|
|
|
Re: Invalid thread access [message #33311 is a reply to message #33276] |
Wed, 25 April 2007 10:49 |
Eclipse User |
|
|
|
Originally posted by: swetha.yahoo.co.in
Hi,
This error is gone.. donno the reason.. I just copied my project in new
workspace and I opened that workspace and run .. working as usual...
In fact my friend also faced the same problem once.. he told to do like
this.. and this is working.. what could be the reason..
Thanks,
Swetha
|
|
|
|
Re: Invalid thread access [message #581120 is a reply to message #33141] |
Wed, 25 April 2007 07:40 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Hi,
Well the root cause see seems to be that your createPartControl isn't
executed in the GUI-Thread or better said something is calling
createPartControl() in another thread than the GUI is running in. Could
you try simply calling:
public void createPartControl(Composite parent) {
Display.getDefault().getSystemColor(SWT.COLOR_LIST_FOREGROUN D);
}
If this also produces an exception please log a bug against platform-ui.
The nebula-code is not the culprit here I think although I have only
looked at the parts you presented here.
Tom
Swetha schrieb:
> Hi,
>
> I am developing a Gallery View using nebula gallery widget,
> the createPartControl method is,
>
> public void createPartControl(Composite parent)
> {
>
> gallery = new Gallery(parent, SWT.V_SCROLL);
> );
> noGroupRenderer = new NoGroupRenderer();
> defaultGalleryItemRenderer = new DefaultGalleryItemRenderer();
>
> (some other code)---------
> ------
> -----------
> }
>
> the error is coming at the line defaultGalleryItemRenderer = new
> DefaultGalleryItemRenderer();
>
> in DefaultGalleryItemRenderer class the error is at the line,
> foregroundColor =
> Display.getDefault().getSystemColor(SWT.COLOR_LIST_FOREGROUN D);
>
> public DefaultGalleryItemRenderer() {
> foregroundColor =
> Display.getDefault().getSystemColor(SWT.COLOR_LIST_FOREGROUN D);
> backgroundColor =
> Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUN D);
> selectionForegroundColor = foregroundColor;
> selectionBackgroundColor =
> Display.getDefault().getSystemColor(SWT.COLOR_LIST_SELECTION );
>
> // Create drop shadows
> createColors();
> }
>
>
> The error is,
>
> 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.error(Display.java:978)
> at org.eclipse.swt.widgets.Display.checkDevice(Display.java:638 )
> at org.eclipse.swt.widgets.Display.getSystemColor(Display.java: 1931)
> at
> org.eclipse.nebula.widgets.gallery.DefaultGalleryItemRendere r. <init>(DefaultGalleryItemRenderer.java:63)
>
> at
> com.sequenom.everest.ui.project.GalleryView.createPartContro l(GalleryView.java:335)
>
> at
> org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:332)
>
> at org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:197)
> at
> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:566)
>
> at
> org.eclipse.ui.internal.WorkbenchPage$ActivationList.setActi ve(WorkbenchPage.java:3915)
>
> at
> org.eclipse.ui.internal.WorkbenchPage.restoreState(Workbench Page.java:2929)
> at
> org.eclipse.ui.internal.WorkbenchWindow.restoreState(Workben chWindow.java:1936)
>
> at org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.j ava:2857)
> at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1665)
> at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1 650)
> at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1529 )
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1473)
> at
> org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(Wor kbenchConfigur
>
>
> Please help me in this,
>
> Thanks in advance,
> Swetha
>
>
>
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05063 seconds