Error inserting image on button control

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Error inserting image on button control

Postby domfe » Thu Oct 14, 2010 11:43 pm

Hello.
I'm getting an error when clicking on "..." to add an image on a button.
I'm using WBP to edit an xwt file.

Code: Select all
Message:
Designer [8.0.0.r36x201010111009]: org.eclipse.jdt.internal.core.PackageFragmentRoot cannot be cast to org.eclipse.jdt.core.IPackageFragment

Exception Stack Trace:
java.lang.ClassCastException: org.eclipse.jdt.internal.core.PackageFragmentRoot cannot be cast to org.eclipse.jdt.core.IPackageFragment
at com.instantiations.designer.xwt.model.property.editor.ImagePropertyEditor.getContextPackagePath(ImagePropertyEditor.java:105)
at com.instantiations.designer.xwt.model.property.editor.ImagePropertyEditor.openDialog(ImagePropertyEditor.java:68)
at com.instantiations.designer.core.model.property.editor.TextDialogPropertyEditor$1.onClick(TextDialogPropertyEditor.java:25)
at com.instantiations.designer.core.model.property.editor.presentation.ButtonPropertyEditorPresentationImpl$4$1.run(ButtonPropertyEditorPresentationImpl.java:106)
at com.instantiations.designer.core.utils.execution.ExecutionUtils.runLog(ExecutionUtils.java:86)
at com.instantiations.designer.core.model.property.editor.presentation.ButtonPropertyEditorPresentationImpl$4.handleEvent(ButtonPropertyEditorPresentationImpl.java:104)
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:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
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:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

Session Data:
java.version=1.6.0_21
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=it_IT
Framework arguments:  -product org.eclipse.epp.package.cpp.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.cpp.product


I'm missing some packages?

Thanks.
domfe
 
Posts: 46
Joined: Mon Oct 04, 2010 6:42 am

Re: Error inserting image on button control

Postby Eric Clayberg » Fri Oct 15, 2010 7:06 pm

Do you have the XWT file in a package or just the root of your source folder?

Any Java classed and XWT files should be placed into Java packages.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Error inserting image on button control

Postby domfe » Mon Oct 18, 2010 2:13 am

Ok. Now the Image button works. The xwt was in the root and not in a package.

Thank you.
domfe
 
Posts: 46
Joined: Mon Oct 04, 2010 6:42 am

Re: Error inserting image on button control

Postby Eric Clayberg » Mon Oct 18, 2010 2:58 am

Glad that worked for you.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest

cron