Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Class cast exception trying to modify values in a property sheet
Class cast exception trying to modify values in a property sheet [message #384555] Sun, 02 May 2004 22:09 Go to next message
Eclipse UserFriend
Originally posted by: Alexander.Eiken.post.rwth-aachen.de

Hello,

i use the generated adapter classes of the EMF.Edit framework to
construct a property sheet page. Everytime i try to edit an EString or
an EInt attribute I get the following exception:

Unhandled event loop exception
Reason:
java.lang.ClassCastException

The exception occurs when the value field gets the focus for editing.
Boolean or enumeration values in the property sheet can be modified
without any errors. I use Eclipse M8 with the EMF 2.0 version from April
the 4th.

Any suggestions would be appreciated.

Thanks, Alexander.
Re: Class cast exception trying to modify values in a property sheet [message #384565 is a reply to message #384555] Mon, 03 May 2004 11:40 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30559
Registered: July 2009
Senior Member
Alexander,

I can't reproduce this so I'm not sure what would cause this and without a
stack trace I can't know much of anything. The trace should be in the
workspace/.metadata/.log.


Alexander Eiken wrote:

> Hello,
>
> i use the generated adapter classes of the EMF.Edit framework to
> construct a property sheet page. Everytime i try to edit an EString or
> an EInt attribute I get the following exception:
>
> Unhandled event loop exception
> Reason:
> java.lang.ClassCastException
>
> The exception occurs when the value field gets the focus for editing.
> Boolean or enumeration values in the property sheet can be modified
> without any errors. I use Eclipse M8 with the EMF 2.0 version from April
> the 4th.
>
> Any suggestions would be appreciated.
>
> Thanks, Alexander.
Re: Class cast exception trying to modify values in a property sheet [message #384570 is a reply to message #384565] Mon, 03 May 2004 12:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Alexander.Eiken.post.rwth-aachen.de

Ed,

here is the stack trace of the exception:

!SESSION Mai 03, 2004 14:02:43.138
---------------------------------------------
java.version=1.4.2
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=de_DE
!ENTRY org.eclipse.ui 4 4 Mai 03, 2004 14:02:43.139
!MESSAGE Unhandled event loop exception
!ENTRY org.eclipse.ui 4 0 Mai 03, 2004 14:02:43.140
!MESSAGE java.lang.ClassCastException
!STACK 0
java.lang.ClassCastException
at
org.eclipse.emf.edit.ui.provider.PropertyDescriptor$1.isVali d(PropertyDescriptor.java:149)
at org.eclipse.jface.viewers.CellEditor.isCorrect(CellEditor.ja va:484)
at org.eclipse.jface.viewers.CellEditor.setValue(CellEditor.jav a:782)
at
org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.getEditor(UndoablePropertySheetEntry.java:335)
at
org.eclipse.ui.views.properties.PropertySheetViewer.activate CellEditor(PropertySheetViewer.java:143)
at
org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertySheetViewer.java:598)
at
org.eclipse.ui.views.properties.PropertySheetViewer.access$6 (PropertySheetViewer.java:576)
at
org.eclipse.ui.views.properties.PropertySheetViewer$4.mouseD own(PropertySheetViewer.java:667)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:132)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:939)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1953)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1726)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1562)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1536)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:257)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:139)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:90)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:277)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:239)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.basicRun(Main.java:267)
at org.eclipse.core.launcher.Main.run(Main.java:692)
at org.eclipse.core.launcher.Main.main(Main.java:676)

Ed Merks schrieb:
> Alexander,
>
> I can't reproduce this so I'm not sure what would cause this and without a
> stack trace I can't know much of anything. The trace should be in the
> workspace/.metadata/.log.
>
>
> Alexander Eiken wrote:
>
>
>>Hello,
>>
>>i use the generated adapter classes of the EMF.Edit framework to
>>construct a property sheet page. Everytime i try to edit an EString or
>>an EInt attribute I get the following exception:
>>
>>Unhandled event loop exception
>>Reason:
>>java.lang.ClassCastException
>>
>>The exception occurs when the value field gets the focus for editing.
>>Boolean or enumeration values in the property sheet can be modified
>>without any errors. I use Eclipse M8 with the EMF 2.0 version from April
>>the 4th.
>>
>>Any suggestions would be appreciated.
>>
>>Thanks, Alexander.
>
>
Re: Class cast exception trying to modify values in a property sheet [message #384573 is a reply to message #384570] Mon, 03 May 2004 12:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30559
Registered: July 2009
Senior Member
Alex,

I see that GEF is on the stack. I seem to recall something about needing to do getEditableValue. The validation
step is failing because the value must either be a valid instance of the data type, which is tested first, and
failing that, it must be a string that can be converted to a valid instance of the data type; probably you have some
kind of value wrapper thing happening...


Alexander Eiken wrote:

> Ed,
>
> here is the stack trace of the exception:
>
> !SESSION Mai 03, 2004 14:02:43.138
> ---------------------------------------------
> java.version=1.4.2
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=de_DE
> !ENTRY org.eclipse.ui 4 4 Mai 03, 2004 14:02:43.139
> !MESSAGE Unhandled event loop exception
> !ENTRY org.eclipse.ui 4 0 Mai 03, 2004 14:02:43.140
> !MESSAGE java.lang.ClassCastException
> !STACK 0
> java.lang.ClassCastException
> at
> org.eclipse.emf.edit.ui.provider.PropertyDescriptor$1.isVali d(PropertyDescriptor.java:149)
> at org.eclipse.jface.viewers.CellEditor.isCorrect(CellEditor.ja va:484)
> at org.eclipse.jface.viewers.CellEditor.setValue(CellEditor.jav a:782)
> at
> org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.getEditor(UndoablePropertySheetEntry.java:335)
> at
> org.eclipse.ui.views.properties.PropertySheetViewer.activate CellEditor(PropertySheetViewer.java:143)
> at
> org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertySheetViewer.java:598)
> at
> org.eclipse.ui.views.properties.PropertySheetViewer.access$6 (PropertySheetViewer.java:576)
> at
> org.eclipse.ui.views.properties.PropertySheetViewer$4.mouseD own(PropertySheetViewer.java:667)
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:132)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:939)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1953)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1726)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1562)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1536)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:257)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:139)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:90)
> at
> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:277)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:239)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:117)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at org.eclipse.core.launcher.Main.basicRun(Main.java:267)
> at org.eclipse.core.launcher.Main.run(Main.java:692)
> at org.eclipse.core.launcher.Main.main(Main.java:676)
>
> Ed Merks schrieb:
> > Alexander,
> >
> > I can't reproduce this so I'm not sure what would cause this and without a
> > stack trace I can't know much of anything. The trace should be in the
> > workspace/.metadata/.log.
> >
> >
> > Alexander Eiken wrote:
> >
> >
> >>Hello,
> >>
> >>i use the generated adapter classes of the EMF.Edit framework to
> >>construct a property sheet page. Everytime i try to edit an EString or
> >>an EInt attribute I get the following exception:
> >>
> >>Unhandled event loop exception
> >>Reason:
> >>java.lang.ClassCastException
> >>
> >>The exception occurs when the value field gets the focus for editing.
> >>Boolean or enumeration values in the property sheet can be modified
> >>without any errors. I use Eclipse M8 with the EMF 2.0 version from April
> >>the 4th.
> >>
> >>Any suggestions would be appreciated.
> >>
> >>Thanks, Alexander.
> >
> >
Re: Class cast exception trying to modify values in a property sheet [message #1700713 is a reply to message #384573] Mon, 06 July 2015 15:19 Go to previous message
qwer qwer is currently offline qwer qwerFriend
Messages: 9
Registered: June 2015
Junior Member
No Message Body
Previous Topic:How to implement a label propagation?
Next Topic:How to extends the copy/paste command ?
Goto Forum:
  


Current Time: Wed Oct 23 17:49:30 GMT 2019

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

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

Back to the top