Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Problem with UndoablePropertySheetEntry and EMF generated CellEditors
Problem with UndoablePropertySheetEntry and EMF generated CellEditors [message #131914] Wed, 12 May 2004 21:27 Go to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 39
Registered: July 2009
Member
Greetings all,

I am having a problem getting my EMF-generated PropertySource to work well
with the Property Sheet when GEF's UndoablePropertySheetEntry is being
used as the underlying model for the PropertySheet.

I have a GraphicalNodeEditPart which is using an EMF model as its
underlying data model. EMF is generating an IPropertySource for me via an
adapter generated by EMF.Edit. My GraphicalNodeEditPart implements the
IPropertySource interface through the IAdaptable interface (which
UndoablePropertySheetEntry calls automatically when a selection-based
property sheet is loaded for a GEF object).

The property sheet loads the initial data just fine, but I go to edit it,
two problems occur:

1) If the underlying type is a boolean, a ComboBoxCellEditor is returned
by the EMF PropertyDescriptor and when I select the combo box sometimes, I
get an exception trace item 1 below. The exception is being generated
inside EMF generated code, seemingly because UndoablePropertySheetEntry is
trying to a "set" on the property before a valid value has been selected
in the combo box.

2) If the underlying type is a String, a default TextCellEditor is
returned by the EMF PropertyDescriptor and when I select the text box to
edit (always), I get a ClassCastException like item 2 below. This one may
be a EMF issue, but seems to be caused by the fact that EMF code assumes
an unwrapped eData object whereas UndoablePropertySheetEntry is passing a
wrapped one.

Any ideas or workarounds? I can't seem to find any bugs against this...

Configuration is: Eclipse M8, GEF 2.1.3 and EMF 2.0.0 I200405060858


Thanks,

Cameron


Item 1:

java.lang.NullPointerException
at
com.rim.wica.impl.DataComponentDefnImpl.eSet(DataComponentDe fnImpl.java:456)
at
org.eclipse.emf.edit.provider.ItemPropertyDescriptor.setProp ertyValue(ItemPropertyDescriptor.java:917)
at
org.eclipse.emf.edit.ui.provider.PropertySource.setPropertyV alue(PropertySource.java:118)
at
editparts.MoveableDataEditPart.setPropertyValue(MoveableData EditPart.java:94)
at
org.eclipse.gef.internal.ui.properties.SetPropertyValueComma nd.execute(SetPropertyValueCommand.java:53)
at
org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
at
org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
at org.eclipse.gef.commands.CommandStack.execute(CommandStack.j ava:78)
at
org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.valueChanged(UndoablePropertySheetEntry.java:720)
at
org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.setValue(UndoablePropertySheetEntry.java:649)
at
org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.applyEditorValue(UndoablePropertySheetEntry.java:128)
at
org.eclipse.ui.views.properties.PropertySheetViewer.applyEdi torValue(PropertySheetViewer.java:233)
at
org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertySheetViewer.java:579)
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:769)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
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)

Item 2:
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:769)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
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)
Re: Problem with UndoablePropertySheetEntry and EMF generated CellEditors [message #131944 is a reply to message #131914] Wed, 12 May 2004 22:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

I don't know if this is your problem, but why are you using GEF 2.1.3 with
Eclipse 3.0 M8? Have you tried a 3.0 build of GEF?

"Cameron Bateman" <cbateman@rim.com> wrote in message
news:c7u4rm$qps$1@eclipse.org...
> Greetings all,
>
> I am having a problem getting my EMF-generated PropertySource to work well
> with the Property Sheet when GEF's UndoablePropertySheetEntry is being
> used as the underlying model for the PropertySheet.
>
> I have a GraphicalNodeEditPart which is using an EMF model as its
> underlying data model. EMF is generating an IPropertySource for me via an
> adapter generated by EMF.Edit. My GraphicalNodeEditPart implements the
> IPropertySource interface through the IAdaptable interface (which
> UndoablePropertySheetEntry calls automatically when a selection-based
> property sheet is loaded for a GEF object).
>
> The property sheet loads the initial data just fine, but I go to edit it,
> two problems occur:
>
> 1) If the underlying type is a boolean, a ComboBoxCellEditor is returned
> by the EMF PropertyDescriptor and when I select the combo box sometimes, I
> get an exception trace item 1 below. The exception is being generated
> inside EMF generated code, seemingly because UndoablePropertySheetEntry is
> trying to a "set" on the property before a valid value has been selected
> in the combo box.
>
> 2) If the underlying type is a String, a default TextCellEditor is
> returned by the EMF PropertyDescriptor and when I select the text box to
> edit (always), I get a ClassCastException like item 2 below. This one may
> be a EMF issue, but seems to be caused by the fact that EMF code assumes
> an unwrapped eData object whereas UndoablePropertySheetEntry is passing a
> wrapped one.
>
> Any ideas or workarounds? I can't seem to find any bugs against this...
>
> Configuration is: Eclipse M8, GEF 2.1.3 and EMF 2.0.0 I200405060858
>
>
> Thanks,
>
> Cameron
>
>
> Item 1:
>
> java.lang.NullPointerException
> at
>
com.rim.wica.impl.DataComponentDefnImpl.eSet(DataComponentDe fnImpl.java:456)
> at
>
org.eclipse.emf.edit.provider.ItemPropertyDescriptor.setProp ertyValue(ItemPr
opertyDescriptor.java:917)
> at
>
org.eclipse.emf.edit.ui.provider.PropertySource.setPropertyV alue(PropertySou
rce.java:118)
> at
>
editparts.MoveableDataEditPart.setPropertyValue(MoveableData EditPart.java:94
)
> at
>
org.eclipse.gef.internal.ui.properties.SetPropertyValueComma nd.execute(SetPr
opertyValueCommand.java:53)
> at
> org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
> at
> org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
> at org.eclipse.gef.commands.CommandStack.execute(CommandStack.j ava:78)
> at
>
org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.valueChang
ed(UndoablePropertySheetEntry.java:720)
> at
>
org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.setValue(U
ndoablePropertySheetEntry.java:649)
> at
>
org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.applyEdito
rValue(UndoablePropertySheetEntry.java:128)
> at
>
org.eclipse.ui.views.properties.PropertySheetViewer.applyEdi torValue(Propert
ySheetViewer.java:233)
> at
>
org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertyShe
etViewer.java:579)
> at
>
org.eclipse.ui.views.properties.PropertySheetViewer.access$6 (PropertySheetVi
ewer.java:576)
> at
>
org.eclipse.ui.views.properties.PropertySheetViewer$4.mouseD own(PropertyShee
tViewer.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:769)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
> 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)
>
> Item 2:
> java.lang.ClassCastException
> at
>
org.eclipse.emf.edit.ui.provider.PropertyDescriptor$1.isVali d(PropertyDescri
ptor.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(Prope
rtySheetViewer.java:143)
> at
>
org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertyShe
etViewer.java:598)
> at
>
org.eclipse.ui.views.properties.PropertySheetViewer.access$6 (PropertySheetVi
ewer.java:576)
> at
>
org.eclipse.ui.views.properties.PropertySheetViewer$4.mouseD own(PropertyShee
tViewer.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:769)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
> 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)
>
Re: Problem with UndoablePropertySheetEntry and EMF generated CellEditors [message #131955 is a reply to message #131914] Wed, 12 May 2004 23:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

I recommend writing your own custom implementation of IPropertySource.
Open a bugzilla, we can consider changing the undo behavior of
SetProperty...Command.

"Cameron Bateman" <cbateman@rim.com> wrote in message
news:c7u4rm$qps$1@eclipse.org...
> Greetings all,
>
> I am having a problem getting my EMF-generated PropertySource to work well
> with the Property Sheet when GEF's UndoablePropertySheetEntry is being
> used as the underlying model for the PropertySheet.
>
> I have a GraphicalNodeEditPart which is using an EMF model as its
> underlying data model. EMF is generating an IPropertySource for me via an
> adapter generated by EMF.Edit. My GraphicalNodeEditPart implements the
> IPropertySource interface through the IAdaptable interface (which
> UndoablePropertySheetEntry calls automatically when a selection-based
> property sheet is loaded for a GEF object).
>
> The property sheet loads the initial data just fine, but I go to edit it,
> two problems occur:
>
> 1) If the underlying type is a boolean, a ComboBoxCellEditor is returned
> by the EMF PropertyDescriptor and when I select the combo box sometimes, I
> get an exception trace item 1 below. The exception is being generated
> inside EMF generated code, seemingly because UndoablePropertySheetEntry is
> trying to a "set" on the property before a valid value has been selected
> in the combo box.
>
> 2) If the underlying type is a String, a default TextCellEditor is
> returned by the EMF PropertyDescriptor and when I select the text box to
> edit (always), I get a ClassCastException like item 2 below. This one may
> be a EMF issue, but seems to be caused by the fact that EMF code assumes
> an unwrapped eData object whereas UndoablePropertySheetEntry is passing a
> wrapped one.
>
> Any ideas or workarounds? I can't seem to find any bugs against this...
>
> Configuration is: Eclipse M8, GEF 2.1.3 and EMF 2.0.0 I200405060858
>
>
> Thanks,
>
> Cameron
>
>
> Item 1:
>
> java.lang.NullPointerException
> at
>
com.rim.wica.impl.DataComponentDefnImpl.eSet(DataComponentDe fnImpl.java:456)
> at
>
org.eclipse.emf.edit.provider.ItemPropertyDescriptor.setProp ertyValue(ItemPr
opertyDescriptor.java:917)
> at
>
org.eclipse.emf.edit.ui.provider.PropertySource.setPropertyV alue(PropertySou
rce.java:118)
> at
>
editparts.MoveableDataEditPart.setPropertyValue(MoveableData EditPart.java:94
)
> at
>
org.eclipse.gef.internal.ui.properties.SetPropertyValueComma nd.execute(SetPr
opertyValueCommand.java:53)
> at
> org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
> at
> org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
> at org.eclipse.gef.commands.CommandStack.execute(CommandStack.j ava:78)
> at
>
org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.valueChang
ed(UndoablePropertySheetEntry.java:720)
> at
>
org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.setValue(U
ndoablePropertySheetEntry.java:649)
> at
>
org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.applyEdito
rValue(UndoablePropertySheetEntry.java:128)
> at
>
org.eclipse.ui.views.properties.PropertySheetViewer.applyEdi torValue(Propert
ySheetViewer.java:233)
> at
>
org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertyShe
etViewer.java:579)
> at
>
org.eclipse.ui.views.properties.PropertySheetViewer.access$6 (PropertySheetVi
ewer.java:576)
> at
>
org.eclipse.ui.views.properties.PropertySheetViewer$4.mouseD own(PropertyShee
tViewer.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:769)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
> 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)
>
> Item 2:
> java.lang.ClassCastException
> at
>
org.eclipse.emf.edit.ui.provider.PropertyDescriptor$1.isVali d(PropertyDescri
ptor.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(Prope
rtySheetViewer.java:143)
> at
>
org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertyShe
etViewer.java:598)
> at
>
org.eclipse.ui.views.properties.PropertySheetViewer.access$6 (PropertySheetVi
ewer.java:576)
> at
>
org.eclipse.ui.views.properties.PropertySheetViewer$4.mouseD own(PropertyShee
tViewer.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:769)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
> 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)
>
Re: Problem with UndoablePropertySheetEntry and EMF generated CellEditors [message #131980 is a reply to message #131944] Thu, 13 May 2004 13:41 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 39
Registered: July 2009
Member
Hmm... 2.1.3 is listed as the latest release on the download page...
would I be looking for a "current integration build" then? It's not clear
to me from the download page which ones are version 3.0.

--Cam


Whitney Sorenson wrote:

> I don't know if this is your problem, but why are you using GEF 2.1.3 with
> Eclipse 3.0 M8? Have you tried a 3.0 build of GEF?

> "Cameron Bateman" <cbateman@rim.com> wrote in message
> news:c7u4rm$qps$1@eclipse.org...
> > Greetings all,
> >
> > I am having a problem getting my EMF-generated PropertySource to work well
> > with the Property Sheet when GEF's UndoablePropertySheetEntry is being
> > used as the underlying model for the PropertySheet.
> >
> > I have a GraphicalNodeEditPart which is using an EMF model as its
> > underlying data model. EMF is generating an IPropertySource for me via an
> > adapter generated by EMF.Edit. My GraphicalNodeEditPart implements the
> > IPropertySource interface through the IAdaptable interface (which
> > UndoablePropertySheetEntry calls automatically when a selection-based
> > property sheet is loaded for a GEF object).
> >
> > The property sheet loads the initial data just fine, but I go to edit it,
> > two problems occur:
> >
> > 1) If the underlying type is a boolean, a ComboBoxCellEditor is returned
> > by the EMF PropertyDescriptor and when I select the combo box sometimes, I
> > get an exception trace item 1 below. The exception is being generated
> > inside EMF generated code, seemingly because UndoablePropertySheetEntry is
> > trying to a "set" on the property before a valid value has been selected
> > in the combo box.
> >
> > 2) If the underlying type is a String, a default TextCellEditor is
> > returned by the EMF PropertyDescriptor and when I select the text box to
> > edit (always), I get a ClassCastException like item 2 below. This one may
> > be a EMF issue, but seems to be caused by the fact that EMF code assumes
> > an unwrapped eData object whereas UndoablePropertySheetEntry is passing a
> > wrapped one.
> >
> > Any ideas or workarounds? I can't seem to find any bugs against this...
> >
> > Configuration is: Eclipse M8, GEF 2.1.3 and EMF 2.0.0 I200405060858
> >
> >
> > Thanks,
> >
> > Cameron
> >
> >
> > Item 1:
> >
> > java.lang.NullPointerException
> > at
> >
> com.rim.wica.impl.DataComponentDefnImpl.eSet(DataComponentDe fnImpl.java:456)
> > at
> >
> org.eclipse.emf.edit.provider.ItemPropertyDescriptor.setProp ertyValue(ItemPr
> opertyDescriptor.java:917)
> > at
> >
> org.eclipse.emf.edit.ui.provider.PropertySource.setPropertyV alue(PropertySou
> rce.java:118)
> > at
> >
> editparts.MoveableDataEditPart.setPropertyValue(MoveableData EditPart.java:94
> )
> > at
> >
> org.eclipse.gef.internal.ui.properties.SetPropertyValueComma nd.execute(SetPr
> opertyValueCommand.java:53)
> > at
> > org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
> > at
> > org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
> > at org.eclipse.gef.commands.CommandStack.execute(CommandStack.j ava:78)
> > at
> >
> org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.valueChang
> ed(UndoablePropertySheetEntry.java:720)
> > at
> >
> org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.setValue(U
> ndoablePropertySheetEntry.java:649)
> > at
> >
> org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.applyEdito
> rValue(UndoablePropertySheetEntry.java:128)
> > at
> >
> org.eclipse.ui.views.properties.PropertySheetViewer.applyEdi torValue(Propert
> ySheetViewer.java:233)
> > at
> >
> org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertyShe
> etViewer.java:579)
> > at
> >
> org.eclipse.ui.views.properties.PropertySheetViewer.access$6 (PropertySheetVi
> ewer.java:576)
> > at
> >
> org.eclipse.ui.views.properties.PropertySheetViewer$4.mouseD own(PropertyShee
> tViewer.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:769)
> > at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
> > at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
> > 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)
> >
> > Item 2:
> > java.lang.ClassCastException
> > at
> >
> org.eclipse.emf.edit.ui.provider.PropertyDescriptor$1.isVali d(PropertyDescri
> ptor.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(Prope
> rtySheetViewer.java:143)
> > at
> >
> org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertyShe
> etViewer.java:598)
> > at
> >
> org.eclipse.ui.views.properties.PropertySheetViewer.access$6 (PropertySheetVi
> ewer.java:576)
> > at
> >
> org.eclipse.ui.views.properties.PropertySheetViewer$4.mouseD own(PropertyShee
> tViewer.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:769)
> > at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
> > at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
> > 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)
> >
Re: Problem with UndoablePropertySheetEntry and EMF generated CellEditors [message #132004 is a reply to message #131980] Thu, 13 May 2004 15:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

It's the latest full release - just like 2.1.3 is the latest Eclipse full
release. You need to look at the integration builds, here is a link to one
that is specifically targeted for Eclipse M8.
http://download.eclipse.org/tools/gef/downloads/drops/I-I200 40401-200404010005/index.php.
You'll see it says Requirements: Eclipse build 3.0M8.


"Cameron Bateman" <cbateman@rim.com> wrote in message
news:c7vtv6$nok$1@eclipse.org...
> Hmm... 2.1.3 is listed as the latest release on the download page...
> would I be looking for a "current integration build" then? It's not clear
> to me from the download page which ones are version 3.0.
>
> --Cam
>
>
> Whitney Sorenson wrote:
>
> > I don't know if this is your problem, but why are you using GEF 2.1.3
with
> > Eclipse 3.0 M8? Have you tried a 3.0 build of GEF?
>
> > "Cameron Bateman" <cbateman@rim.com> wrote in message
> > news:c7u4rm$qps$1@eclipse.org...
> > > Greetings all,
> > >
> > > I am having a problem getting my EMF-generated PropertySource to work
well
> > > with the Property Sheet when GEF's UndoablePropertySheetEntry is being
> > > used as the underlying model for the PropertySheet.
> > >
> > > I have a GraphicalNodeEditPart which is using an EMF model as its
> > > underlying data model. EMF is generating an IPropertySource for me
via an
> > > adapter generated by EMF.Edit. My GraphicalNodeEditPart implements
the
> > > IPropertySource interface through the IAdaptable interface (which
> > > UndoablePropertySheetEntry calls automatically when a selection-based
> > > property sheet is loaded for a GEF object).
> > >
> > > The property sheet loads the initial data just fine, but I go to edit
it,
> > > two problems occur:
> > >
> > > 1) If the underlying type is a boolean, a ComboBoxCellEditor is
returned
> > > by the EMF PropertyDescriptor and when I select the combo box
sometimes, I
> > > get an exception trace item 1 below. The exception is being generated
> > > inside EMF generated code, seemingly because
UndoablePropertySheetEntry is
> > > trying to a "set" on the property before a valid value has been
selected
> > > in the combo box.
> > >
> > > 2) If the underlying type is a String, a default TextCellEditor is
> > > returned by the EMF PropertyDescriptor and when I select the text box
to
> > > edit (always), I get a ClassCastException like item 2 below. This one
may
> > > be a EMF issue, but seems to be caused by the fact that EMF code
assumes
> > > an unwrapped eData object whereas UndoablePropertySheetEntry is
passing a
> > > wrapped one.
> > >
> > > Any ideas or workarounds? I can't seem to find any bugs against
this...
> > >
> > > Configuration is: Eclipse M8, GEF 2.1.3 and EMF 2.0.0 I200405060858
> > >
> > >
> > > Thanks,
> > >
> > > Cameron
> > >
> > >
> > > Item 1:
> > >
> > > java.lang.NullPointerException
> > > at
> > >
> >
com.rim.wica.impl.DataComponentDefnImpl.eSet(DataComponentDe fnImpl.java:456)
> > > at
> > >
> >
org.eclipse.emf.edit.provider.ItemPropertyDescriptor.setProp ertyValue(ItemPr
> > opertyDescriptor.java:917)
> > > at
> > >
> >
org.eclipse.emf.edit.ui.provider.PropertySource.setPropertyV alue(PropertySou
> > rce.java:118)
> > > at
> > >
> >
editparts.MoveableDataEditPart.setPropertyValue(MoveableData EditPart.java:94
> > )
> > > at
> > >
> >
org.eclipse.gef.internal.ui.properties.SetPropertyValueComma nd.execute(SetPr
> > opertyValueCommand.java:53)
> > > at
> > >
org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
> > > at
> > >
org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
> > > at org.eclipse.gef.commands.CommandStack.execute(CommandStack.j ava:78)
> > > at
> > >
> >
org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.valueChang
> > ed(UndoablePropertySheetEntry.java:720)
> > > at
> > >
> >
org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.setValue(U
> > ndoablePropertySheetEntry.java:649)
> > > at
> > >
> >
org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.applyEdito
> > rValue(UndoablePropertySheetEntry.java:128)
> > > at
> > >
> >
org.eclipse.ui.views.properties.PropertySheetViewer.applyEdi torValue(Propert
> > ySheetViewer.java:233)
> > > at
> > >
> >
org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertyShe
> > etViewer.java:579)
> > > at
> > >
> >
org.eclipse.ui.views.properties.PropertySheetViewer.access$6 (PropertySheetVi
> > ewer.java:576)
> > > at
> > >
> >
org.eclipse.ui.views.properties.PropertySheetViewer$4.mouseD own(PropertyShee
> > tViewer.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:769)
> > > at
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
> > > at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
> > > 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)
> > >
> > > Item 2:
> > > java.lang.ClassCastException
> > > at
> > >
> >
org.eclipse.emf.edit.ui.provider.PropertyDescriptor$1.isVali d(PropertyDescri
> > ptor.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(Prope
> > rtySheetViewer.java:143)
> > > at
> > >
> >
org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertyShe
> > etViewer.java:598)
> > > at
> > >
> >
org.eclipse.ui.views.properties.PropertySheetViewer.access$6 (PropertySheetVi
> > ewer.java:576)
> > > at
> > >
> >
org.eclipse.ui.views.properties.PropertySheetViewer$4.mouseD own(PropertyShee
> > tViewer.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:769)
> > > at
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
> > > at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
> > > 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)
> > >
>
>
Re: Problem with UndoablePropertySheetEntry and EMF generated CellEditors [message #132053 is a reply to message #132004] Thu, 13 May 2004 16:59 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 39
Registered: July 2009
Member
Aha, thanks I'm not up the correct level. Well, the problem with the
ComboBox now *seems* to have gone away. The problem with the default
TextEditor still seems to be there. I will launch a bug for this as
suggested.

Thanks,

Cameron

Whitney Sorenson wrote:

> It's the latest full release - just like 2.1.3 is the latest Eclipse full
> release. You need to look at the integration builds, here is a link to one
> that is specifically targeted for Eclipse M8.
>
http://download.eclipse.org/tools/gef/downloads/drops/I-I200 40401-200404010005/index.php.
> You'll see it says Requirements: Eclipse build 3.0M8.


> "Cameron Bateman" <cbateman@rim.com> wrote in message
> news:c7vtv6$nok$1@eclipse.org...
> > Hmm... 2.1.3 is listed as the latest release on the download page...
> > would I be looking for a "current integration build" then? It's not clear
> > to me from the download page which ones are version 3.0.
> >
> > --Cam
> >
> >
> > Whitney Sorenson wrote:
> >
> > > I don't know if this is your problem, but why are you using GEF 2.1.3
> with
> > > Eclipse 3.0 M8? Have you tried a 3.0 build of GEF?
> >
> > > "Cameron Bateman" <cbateman@rim.com> wrote in message
> > > news:c7u4rm$qps$1@eclipse.org...
> > > > Greetings all,
> > > >
> > > > I am having a problem getting my EMF-generated PropertySource to work
> well
> > > > with the Property Sheet when GEF's UndoablePropertySheetEntry is being
> > > > used as the underlying model for the PropertySheet.
> > > >
> > > > I have a GraphicalNodeEditPart which is using an EMF model as its
> > > > underlying data model. EMF is generating an IPropertySource for me
> via an
> > > > adapter generated by EMF.Edit. My GraphicalNodeEditPart implements
> the
> > > > IPropertySource interface through the IAdaptable interface (which
> > > > UndoablePropertySheetEntry calls automatically when a selection-based
> > > > property sheet is loaded for a GEF object).
> > > >
> > > > The property sheet loads the initial data just fine, but I go to edit
> it,
> > > > two problems occur:
> > > >
> > > > 1) If the underlying type is a boolean, a ComboBoxCellEditor is
> returned
> > > > by the EMF PropertyDescriptor and when I select the combo box
> sometimes, I
> > > > get an exception trace item 1 below. The exception is being generated
> > > > inside EMF generated code, seemingly because
> UndoablePropertySheetEntry is
> > > > trying to a "set" on the property before a valid value has been
> selected
> > > > in the combo box.
> > > >
> > > > 2) If the underlying type is a String, a default TextCellEditor is
> > > > returned by the EMF PropertyDescriptor and when I select the text box
> to
> > > > edit (always), I get a ClassCastException like item 2 below. This one
> may
> > > > be a EMF issue, but seems to be caused by the fact that EMF code
> assumes
> > > > an unwrapped eData object whereas UndoablePropertySheetEntry is
> passing a
> > > > wrapped one.
> > > >
> > > > Any ideas or workarounds? I can't seem to find any bugs against
> this...
> > > >
> > > > Configuration is: Eclipse M8, GEF 2.1.3 and EMF 2.0.0 I200405060858
> > > >
> > > >
> > > > Thanks,
> > > >
> > > > Cameron
> > > >
> > > >
> > > > Item 1:
> > > >
> > > > java.lang.NullPointerException
> > > > at
> > > >
> > >
> com.rim.wica.impl.DataComponentDefnImpl.eSet(DataComponentDe fnImpl.java:456)
> > > > at
> > > >
> > >
> org.eclipse.emf.edit.provider.ItemPropertyDescriptor.setProp ertyValue(ItemPr
> > > opertyDescriptor.java:917)
> > > > at
> > > >
> > >
> org.eclipse.emf.edit.ui.provider.PropertySource.setPropertyV alue(PropertySou
> > > rce.java:118)
> > > > at
> > > >
> > >
> editparts.MoveableDataEditPart.setPropertyValue(MoveableData EditPart.java:94
> > > )
> > > > at
> > > >
> > >
> org.eclipse.gef.internal.ui.properties.SetPropertyValueComma nd.execute(SetPr
> > > opertyValueCommand.java:53)
> > > > at
> > > >
> org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
> > > > at
> > > >
> org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
> > > > at org.eclipse.gef.commands.CommandStack.execute(CommandStack.j ava:78)
> > > > at
> > > >
> > >
> org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.valueChang
> > > ed(UndoablePropertySheetEntry.java:720)
> > > > at
> > > >
> > >
> org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.setValue(U
> > > ndoablePropertySheetEntry.java:649)
> > > > at
> > > >
> > >
> org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.applyEdito
> > > rValue(UndoablePropertySheetEntry.java:128)
> > > > at
> > > >
> > >
> org.eclipse.ui.views.properties.PropertySheetViewer.applyEdi torValue(Propert
> > > ySheetViewer.java:233)
> > > > at
> > > >
> > >
> org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertyShe
> > > etViewer.java:579)
> > > > at
> > > >
> > >
> org.eclipse.ui.views.properties.PropertySheetViewer.access$6 (PropertySheetVi
> > > ewer.java:576)
> > > > at
> > > >
> > >
> org.eclipse.ui.views.properties.PropertySheetViewer$4.mouseD own(PropertyShee
> > > tViewer.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:769)
> > > > at
> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
> > > > at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
> > > > 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)
> > > >
> > > > Item 2:
> > > > java.lang.ClassCastException
> > > > at
> > > >
> > >
> org.eclipse.emf.edit.ui.provider.PropertyDescriptor$1.isVali d(PropertyDescri
> > > ptor.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(Prope
> > > rtySheetViewer.java:143)
> > > > at
> > > >
> > >
> org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertyShe
> > > etViewer.java:598)
> > > > at
> > > >
> > >
> org.eclipse.ui.views.properties.PropertySheetViewer.access$6 (PropertySheetVi
> > > ewer.java:576)
> > > > at
> > > >
> > >
> org.eclipse.ui.views.properties.PropertySheetViewer$4.mouseD own(PropertyShee
> > > tViewer.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:769)
> > > > at
> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
> > > > at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
> > > > 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)
> > > >
> >
> >
Re: Problem with UndoablePropertySheetEntry and EMF generated CellEditors [message #132193 is a reply to message #131955] Fri, 14 May 2004 14:25 Go to previous message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 39
Registered: July 2009
Member
The workaround is as follows:

1) In your GraphicalEditor, override the getAdapter() method to include
support for IPropertySheetPage and have it return a default
PropertySheetPage with the PropertySource set to your EMF adapter's
adapted property source.

2) In each GraphicalNodeEditPart where you want on-click property page
support, implement the IPropertySource interface directly and have each of
the interface method calls simply proxy the underlying EMF adapted
property source calls.

This seems to work, although it has the one drawback that the Undoable
property sheet is not being used.


--Cam


Randy Hudson wrote:

> I recommend writing your own custom implementation of IPropertySource.
> Open a bugzilla, we can consider changing the undo behavior of
> SetProperty...Command.

> "Cameron Bateman" <cbateman@rim.com> wrote in message
> news:c7u4rm$qps$1@eclipse.org...
> > Greetings all,
> >
> > I am having a problem getting my EMF-generated PropertySource to work well
> > with the Property Sheet when GEF's UndoablePropertySheetEntry is being
> > used as the underlying model for the PropertySheet.
> >
> > I have a GraphicalNodeEditPart which is using an EMF model as its
> > underlying data model. EMF is generating an IPropertySource for me via an
> > adapter generated by EMF.Edit. My GraphicalNodeEditPart implements the
> > IPropertySource interface through the IAdaptable interface (which
> > UndoablePropertySheetEntry calls automatically when a selection-based
> > property sheet is loaded for a GEF object).
> >
> > The property sheet loads the initial data just fine, but I go to edit it,
> > two problems occur:
> >
> > 1) If the underlying type is a boolean, a ComboBoxCellEditor is returned
> > by the EMF PropertyDescriptor and when I select the combo box sometimes, I
> > get an exception trace item 1 below. The exception is being generated
> > inside EMF generated code, seemingly because UndoablePropertySheetEntry is
> > trying to a "set" on the property before a valid value has been selected
> > in the combo box.
> >
> > 2) If the underlying type is a String, a default TextCellEditor is
> > returned by the EMF PropertyDescriptor and when I select the text box to
> > edit (always), I get a ClassCastException like item 2 below. This one may
> > be a EMF issue, but seems to be caused by the fact that EMF code assumes
> > an unwrapped eData object whereas UndoablePropertySheetEntry is passing a
> > wrapped one.
> >
> > Any ideas or workarounds? I can't seem to find any bugs against this...
> >
> > Configuration is: Eclipse M8, GEF 2.1.3 and EMF 2.0.0 I200405060858
> >
> >
> > Thanks,
> >
> > Cameron
> >
> >
> > Item 1:
> >
> > java.lang.NullPointerException
> > at
> >
> com.rim.wica.impl.DataComponentDefnImpl.eSet(DataComponentDe fnImpl.java:456)
> > at
> >
> org.eclipse.emf.edit.provider.ItemPropertyDescriptor.setProp ertyValue(ItemPr
> opertyDescriptor.java:917)
> > at
> >
> org.eclipse.emf.edit.ui.provider.PropertySource.setPropertyV alue(PropertySou
> rce.java:118)
> > at
> >
> editparts.MoveableDataEditPart.setPropertyValue(MoveableData EditPart.java:94
> )
> > at
> >
> org.eclipse.gef.internal.ui.properties.SetPropertyValueComma nd.execute(SetPr
> opertyValueCommand.java:53)
> > at
> > org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
> > at
> > org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
> > at org.eclipse.gef.commands.CommandStack.execute(CommandStack.j ava:78)
> > at
> >
> org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.valueChang
> ed(UndoablePropertySheetEntry.java:720)
> > at
> >
> org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.setValue(U
> ndoablePropertySheetEntry.java:649)
> > at
> >
> org.eclipse.gef.internal.ui.properties.UndoablePropertySheet Entry.applyEdito
> rValue(UndoablePropertySheetEntry.java:128)
> > at
> >
> org.eclipse.ui.views.properties.PropertySheetViewer.applyEdi torValue(Propert
> ySheetViewer.java:233)
> > at
> >
> org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertyShe
> etViewer.java:579)
> > at
> >
> org.eclipse.ui.views.properties.PropertySheetViewer.access$6 (PropertySheetVi
> ewer.java:576)
> > at
> >
> org.eclipse.ui.views.properties.PropertySheetViewer$4.mouseD own(PropertyShee
> tViewer.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:769)
> > at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
> > at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
> > 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)
> >
> > Item 2:
> > java.lang.ClassCastException
> > at
> >
> org.eclipse.emf.edit.ui.provider.PropertyDescriptor$1.isVali d(PropertyDescri
> ptor.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(Prope
> rtySheetViewer.java:143)
> > at
> >
> org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertyShe
> etViewer.java:598)
> > at
> >
> org.eclipse.ui.views.properties.PropertySheetViewer.access$6 (PropertySheetVi
> ewer.java:576)
> > at
> >
> org.eclipse.ui.views.properties.PropertySheetViewer$4.mouseD own(PropertyShee
> tViewer.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:769)
> > at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2578)
> > at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2256)
> > 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)
> >
Previous Topic:What was the bug in the GEF logic example?
Next Topic:Default GEF behavor; why figures are added where they are?
Goto Forum:
  


Current Time: Sat Apr 27 05:17:54 GMT 2024

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

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

Back to the top