Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » Window Builder Design View Problem with SWT(Internal error when opening design view for SWT GUI)
Window Builder Design View Problem with SWT [message #1033752] Thu, 04 April 2013 11:47 Go to next message
Kaloyan Kolev is currently offline Kaloyan Kolev
Messages: 4
Registered: April 2013
Junior Member
I have the latest version of Window Builder Pro installed on my Eclipse 4.2 Juno. When I create a new SWT Application Window, I cannot open the Design view. The code can still be compiled and run, but as soon as I try to open the Design tab a progress bar appears, stops responding after 4-5 seconds, 6-7 seconds after it displays the following error:

Internal Error
WindowBuilder encountered unexpected internal error.

This could be caused by a WindowBuilder bug or by a misconfiguration issue, conflict, partial update, etc.

java.lang.ClassCastException: org.eclipse.swt.widgets.Shell cannot be cast to org.eclipse.swt.widgets.Control

Stack trace:
java.lang.ClassCastException: org.eclipse.swt.widgets.Shell cannot be cast to org.eclipse.swt.widgets.Control
at org.eclipse.wb.os.OSSupport.endShot(OSSupport.java:142)
at org.eclipse.wb.internal.rcp.support.ToolkitSupportImpl.endShot(ToolkitSupportImpl.java:115)
at org.eclipse.wb.internal.swt.support.ToolkitSupport.endShot(ToolkitSupport.java:92)
at org.eclipse.wb.internal.swt.model.widgets.ControlInfo.refresh_fetch(ControlInfo.java:233)
at org.eclipse.wb.internal.swt.model.widgets.ControlInfo.refresh_fetch(ControlInfo.java:157)
at org.eclipse.wb.internal.swt.model.widgets.ControlInfo.refresh_fetch(ControlInfo.java:124)
at org.eclipse.wb.internal.swt.model.widgets.ScrollableInfo.refresh_fetch(ScrollableInfo.java:49)
at org.eclipse.wb.internal.swt.model.widgets.CompositeInfo.refresh_fetch(CompositeInfo.java:301)
at org.eclipse.wb.core.model.ObjectInfo$6$1.run(ObjectInfo.java:496)
at org.eclipse.wb.internal.core.utils.execution.ExecutionUtils.runDesignTime(ExecutionUtils.java:145)
at org.eclipse.wb.core.model.ObjectInfo$6.run(ObjectInfo.java:494)
at org.eclipse.wb.core.model.ObjectInfo.execRefreshOperation(ObjectInfo.java:514)
at org.eclipse.wb.core.model.ObjectInfo.refresh(ObjectInfo.java:492)
at org.eclipse.wb.internal.core.editor.DesignPage.internal_refreshGEF(DesignPage.java:580)
at org.eclipse.wb.internal.core.editor.DesignPage.access$9(DesignPage.java:522)
at org.eclipse.wb.internal.core.editor.DesignPage$8$1.run(DesignPage.java:449)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4687)
at org.eclipse.wb.internal.core.editor.DesignPage$8.run(DesignPage.java:446)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
at org.eclipse.wb.internal.core.editor.DesignPage.internal_refreshGEF_withProgress(DesignPage.java:465)
at org.eclipse.wb.internal.core.editor.DesignPage.internal_refreshGEF(DesignPage.java:415)
at org.eclipse.wb.internal.core.editor.UndoManager.refreshDesignerEditor(UndoManager.java:381)
at org.eclipse.wb.internal.core.editor.UndoManager.activate(UndoManager.java:90)
at org.eclipse.wb.internal.core.editor.DesignPage.handleActiveState_True(DesignPage.java:263)
at org.eclipse.wb.internal.core.editor.DesignPage.handleActiveState(DesignPage.java:241)
at org.eclipse.wb.internal.core.editor.multi.DefaultMultiMode.showPage(DefaultMultiMode.java:125)
at org.eclipse.wb.internal.core.editor.multi.DefaultMultiMode$1.widgetSelected(DefaultMultiMode.java:63)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:774)
at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3028)
at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1749)
at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:278)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
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.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

The Design tab works fine with Swing GUI.
I have attached the report produced by Eclipse.
Thank you.
Re: Window Builder Design View Problem with SWT [message #1036449 is a reply to message #1033752] Mon, 08 April 2013 08:00 Go to previous messageGo to next message
Binko Binev is currently offline Binko Binev
Messages: 20
Registered: June 2012
Junior Member
how does this Shell come there?

Shell e podklas na Control.



Re: Window Builder Design View Problem with SWT [message #1036455 is a reply to message #1033752] Mon, 08 April 2013 08:07 Go to previous messageGo to next message
Binko Binev is currently offline Binko Binev
Messages: 20
Registered: June 2012
Junior Member
Vij tova

https://bugs.eclipse.org/bugs/show_bug.cgi?id=387074
Re: Window Builder Design View Problem with SWT [message #1036604 is a reply to message #1036455] Mon, 08 April 2013 11:50 Go to previous messageGo to next message
Kaloyan Kolev is currently offline Kaloyan Kolev
Messages: 4
Registered: April 2013
Junior Member
Hi Binko

I understand that a subclass cannot be cast to its superclass. What I wanted to know is why Window Builder was trying to do that.

Thank you for the link from which it looks like I need to reinstall JRE.

I na bulgarski, blagodarya.
Re: Window Builder Design View Problem with SWT [message #1036616 is a reply to message #1036604] Mon, 08 April 2013 12:02 Go to previous messageGo to next message
Binko Binev is currently offline Binko Binev
Messages: 20
Registered: June 2012
Junior Member
A subclass can be cast to its superclass. it doesn't work the other way.
You can cast a Shell to a Control but not a Control to a Shell.

It also depends how the variable is initiated at first place.

But your problem seems to be with the JRE.

The cast should work.
Re: Window Builder Design View Problem with SWT [message #1036620 is a reply to message #1036604] Mon, 08 April 2013 12:05 Go to previous messageGo to next message
Binko Binev is currently offline Binko Binev
Messages: 20
Registered: June 2012
Junior Member
The problem may be that your classes are not correctly loaded so that Control is not correctly loaded as superclass of Shell, so that Shell cannot be cast to it.
Re: Window Builder Design View Problem with SWT [message #1036652 is a reply to message #1036620] Mon, 08 April 2013 12:59 Go to previous messageGo to next message
Kaloyan Kolev is currently offline Kaloyan Kolev
Messages: 4
Registered: April 2013
Junior Member
Yes you are right, I got them the other way round for some reason. It turns out I didn't know everything about casting. Smile

I will reinstall JRE and fingers crossed.....
Re: Window Builder Design View Problem with SWT [message #1040127 is a reply to message #1036652] Sat, 13 April 2013 00:10 Go to previous message
Kaloyan Kolev is currently offline Kaloyan Kolev
Messages: 4
Registered: April 2013
Junior Member
I fixed the problem by updating my JDK.
The one I had was JDK SE7 update 13, which I updated to JDK SE7 update 17.
Previous Topic:Data Binding Tab
Next Topic:Issue with Tabbed Pane
Goto Forum:
  


Current Time: Fri Jul 25 19:05:38 EDT 2014

Powered by FUDForum. Page generated in 0.01886 seconds