Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Transaction problem with SortFilterPage
Transaction problem with SortFilterPage [message #15924] Fri, 11 August 2006 12:01 Go to next message
Eclipse UserFriend
Hi,

After sucessfully adding my own SortFilterCompartmentEditPolicy and
SortFilterContentPolicy, i can open the SortFilterDialog via the
"Filters->Sort/Filter compartment items" context menu. So this opens the
dialog and everything is shown correctly. But as soon as i press the
apply or ok button, i get the following exception:
org.eclipse.core.commands.ExecutionException: While executing the
operation, an exception occurred

at
org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:517)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:206)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:169)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:156)
at
org.eclipse.gmf.runtime.diagram.ui.dialogs.sortfilter.SortFi lterPage.performApply(SortFilterPage.java:966)
at
org.eclipse.jface.preference.PreferencePage$2.widgetSelected (PreferencePage.java:282)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:90)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3164)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2840)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:820 )
at org.eclipse.jface.window.Window.open(Window.java:796)
at
org.eclipse.gmf.runtime.diagram.ui.internal.dialogs.sortfilt er.SortFilterDialogUtil.invokeDialog(SortFilterDialogUtil.ja va:72)
at
org.eclipse.gmf.runtime.diagram.ui.editpolicies.SortFilterCo mpartmentItemsEditPolicy.getCommand(SortFilterCompartmentIte msEditPolicy.java:88)
at
org.eclipse.gef.editparts.AbstractEditPart.getCommand(Abstra ctEditPart.java:473)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.access$1(GraphicalEditPart.java:1)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt$1.run(GraphicalEditPart.java:414)
at
org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.runExclusive(TransactionalEditingDomainImpl.java:258)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.getCommand(GraphicalEditPart.java:409)
at
org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.get Command(DiagramAction.java:175)
at
org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.get Command(DiagramAction.java:159)
at
org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.doR un(DiagramAction.java:101)
at
org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er.run(AbstractActionHandler.java:347)
at
org.eclipse.gmf.runtime.common.ui.action.ActionManager$1.run (ActionManager.java:225)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at
org.eclipse.gmf.runtime.common.ui.action.ActionManager.run(A ctionManager.java:223)
at
org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er.runWithEvent(AbstractActionHandler.java:365)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:539)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3164)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2840)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:95)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
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:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: java.lang.IllegalStateException: Cannot activate read/write
transaction in read-only transaction context
at
org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.acquire(TransactionalEditingDomainImpl.java:498)
at
org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.activate(TransactionalEditingDomainImpl.java:436)
at
org.eclipse.emf.transaction.impl.TransactionImpl.start(Trans actionImpl.java:154)
at
org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.startTransaction(TransactionalEditingDomainImpl.java:352 )
at
org.eclipse.emf.workspace.AbstractEMFOperation.createTransac tion(AbstractEMFOperation.java:414)
at
org.eclipse.emf.workspace.AbstractEMFOperation.execute(Abstr actEMFOperation.java:124)
at
org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:509)
.... 52 more

Looks like we're still in the getCommand() method of my compartment edit
part, which is running in a read only transaction. Pressing apply will
then execute the change command inside a read transaction, which causes
this exception.

For me it's unclear if this feature isn't fully implemented or if this
is a bug.

Regards,
Matthias
Re: Transaction problem with SortFilterPage [message #16038 is a reply to message #15924] Fri, 11 August 2006 13:52 Go to previous messageGo to next message
Eclipse UserFriend
Hello Matthias,

You could try returning a command from your edit policy that opens the
dialog when it is executed (from your action). #getCommand may be
called many times, but you probably don't want to make any model changes
until the command that is returned is actually executed.

Hope that helps,
Linda

Matthias Köster wrote:
> Hi,
>
> After sucessfully adding my own SortFilterCompartmentEditPolicy and
> SortFilterContentPolicy, i can open the SortFilterDialog via the
> "Filters->Sort/Filter compartment items" context menu. So this opens the
> dialog and everything is shown correctly. But as soon as i press the
> apply or ok button, i get the following exception:
> org.eclipse.core.commands.ExecutionException: While executing the
> operation, an exception occurred
>
> at
> org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:517)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:206)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:169)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:156)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.dialogs.sortfilter.SortFi lterPage.performApply(SortFilterPage.java:966)
>
> at
> org.eclipse.jface.preference.PreferencePage$2.widgetSelected (PreferencePage.java:282)
>
> at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:90)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3164)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2840)
> at org.eclipse.jface.window.Window.runEventLoop(Window.java:820 )
> at org.eclipse.jface.window.Window.open(Window.java:796)
> at
> org.eclipse.gmf.runtime.diagram.ui.internal.dialogs.sortfilt er.SortFilterDialogUtil.invokeDialog(SortFilterDialogUtil.ja va:72)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.editpolicies.SortFilterCo mpartmentItemsEditPolicy.getCommand(SortFilterCompartmentIte msEditPolicy.java:88)
>
> at
> org.eclipse.gef.editparts.AbstractEditPart.getCommand(Abstra ctEditPart.java:473)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.access$1(GraphicalEditPart.java:1)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt$1.run(GraphicalEditPart.java:414)
>
> at
> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.runExclusive(TransactionalEditingDomainImpl.java:258)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.getCommand(GraphicalEditPart.java:409)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.get Command(DiagramAction.java:175)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.get Command(DiagramAction.java:159)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.doR un(DiagramAction.java:101)
>
> at
> org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er.run(AbstractActionHandler.java:347)
>
> at
> org.eclipse.gmf.runtime.common.ui.action.ActionManager$1.run (ActionManager.java:225)
>
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
> at
> org.eclipse.gmf.runtime.common.ui.action.ActionManager.run(A ctionManager.java:223)
>
> at
> org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er.runWithEvent(AbstractActionHandler.java:365)
>
> at
> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:539)
>
> at
> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
>
> at
> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
>
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3164)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2840)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1914)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:419)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:95)
> at
> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
>
> 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:585)
> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
> at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
> at org.eclipse.core.launcher.Main.run(Main.java:977)
> at org.eclipse.core.launcher.Main.main(Main.java:952)
> Caused by: java.lang.IllegalStateException: Cannot activate read/write
> transaction in read-only transaction context
> at
> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.acquire(TransactionalEditingDomainImpl.java:498)
>
> at
> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.activate(TransactionalEditingDomainImpl.java:436)
>
> at
> org.eclipse.emf.transaction.impl.TransactionImpl.start(Trans actionImpl.java:154)
>
> at
> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.startTransaction(TransactionalEditingDomainImpl.java:352 )
>
> at
> org.eclipse.emf.workspace.AbstractEMFOperation.createTransac tion(AbstractEMFOperation.java:414)
>
> at
> org.eclipse.emf.workspace.AbstractEMFOperation.execute(Abstr actEMFOperation.java:124)
>
> at
> org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:509)
>
> ... 52 more
>
> Looks like we're still in the getCommand() method of my compartment edit
> part, which is running in a read only transaction. Pressing apply will
> then execute the change command inside a read transaction, which causes
> this exception.
>
> For me it's unclear if this feature isn't fully implemented or if this
> is a bug.
>
> Regards,
> Matthias
Re: Transaction problem with SortFilterPage [message #16056 is a reply to message #16038] Fri, 11 August 2006 14:03 Go to previous messageGo to next message
Eclipse UserFriend
I should add that it would be even better if you could open the dialog
from your action. When the user presses apply/ok, get the command from
your edit policy and execute it. This has the advantage of separating
the UI in the action from the semantic behaviour in the edit policy's
command. That being said, it's not always possible to separate the two...

Cheers,
Linda


Linda Damus wrote:
> Hello Matthias,
>
> You could try returning a command from your edit policy that opens the
> dialog when it is executed (from your action). #getCommand may be
> called many times, but you probably don't want to make any model changes
> until the command that is returned is actually executed.
>
> Hope that helps,
> Linda
>
> Matthias Köster wrote:
>> Hi,
>>
>> After sucessfully adding my own SortFilterCompartmentEditPolicy and
>> SortFilterContentPolicy, i can open the SortFilterDialog via the
>> "Filters->Sort/Filter compartment items" context menu. So this opens
>> the dialog and everything is shown correctly. But as soon as i press
>> the apply or ok button, i get the following exception:
>> org.eclipse.core.commands.ExecutionException: While executing the
>> operation, an exception occurred
>>
>> at
>> org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:517)
>>
>> at
>> org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:206)
>>
>> at
>> org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:169)
>>
>> at
>> org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:156)
>>
>> at
>> org.eclipse.gmf.runtime.diagram.ui.dialogs.sortfilter.SortFi lterPage.performApply(SortFilterPage.java:966)
>>
>> at
>> org.eclipse.jface.preference.PreferencePage$2.widgetSelected (PreferencePage.java:282)
>>
>> at
>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:90)
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3164)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2840)
>> at org.eclipse.jface.window.Window.runEventLoop(Window.java:820 )
>> at org.eclipse.jface.window.Window.open(Window.java:796)
>> at
>> org.eclipse.gmf.runtime.diagram.ui.internal.dialogs.sortfilt er.SortFilterDialogUtil.invokeDialog(SortFilterDialogUtil.ja va:72)
>>
>> at
>> org.eclipse.gmf.runtime.diagram.ui.editpolicies.SortFilterCo mpartmentItemsEditPolicy.getCommand(SortFilterCompartmentIte msEditPolicy.java:88)
>>
>> at
>> org.eclipse.gef.editparts.AbstractEditPart.getCommand(Abstra ctEditPart.java:473)
>>
>> at
>> org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.access$1(GraphicalEditPart.java:1)
>>
>> at
>> org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt$1.run(GraphicalEditPart.java:414)
>>
>> at
>> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.runExclusive(TransactionalEditingDomainImpl.java:258)
>>
>> at
>> org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.getCommand(GraphicalEditPart.java:409)
>>
>> at
>> org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.get Command(DiagramAction.java:175)
>>
>> at
>> org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.get Command(DiagramAction.java:159)
>>
>> at
>> org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.doR un(DiagramAction.java:101)
>>
>> at
>> org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er.run(AbstractActionHandler.java:347)
>>
>> at
>> org.eclipse.gmf.runtime.common.ui.action.ActionManager$1.run (ActionManager.java:225)
>>
>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
>> at
>> org.eclipse.gmf.runtime.common.ui.action.ActionManager.run(A ctionManager.java:223)
>>
>> at
>> org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er.runWithEvent(AbstractActionHandler.java:365)
>>
>> at
>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:539)
>>
>> at
>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
>>
>> at
>> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
>>
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3164)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2840)
>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1914)
>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
>> at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:419)
>>
>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:95)
>> at
>> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
>>
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
>>
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
>>
>> 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:585)
>> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
>> at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
>> at org.eclipse.core.launcher.Main.run(Main.java:977)
>> at org.eclipse.core.launcher.Main.main(Main.java:952)
>> Caused by: java.lang.IllegalStateException: Cannot activate read/write
>> transaction in read-only transaction context
>> at
>> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.acquire(TransactionalEditingDomainImpl.java:498)
>>
>> at
>> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.activate(TransactionalEditingDomainImpl.java:436)
>>
>> at
>> org.eclipse.emf.transaction.impl.TransactionImpl.start(Trans actionImpl.java:154)
>>
>> at
>> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.startTransaction(TransactionalEditingDomainImpl.java:352 )
>>
>> at
>> org.eclipse.emf.workspace.AbstractEMFOperation.createTransac tion(AbstractEMFOperation.java:414)
>>
>> at
>> org.eclipse.emf.workspace.AbstractEMFOperation.execute(Abstr actEMFOperation.java:124)
>>
>> at
>> org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:509)
>>
>> ... 52 more
>>
>> Looks like we're still in the getCommand() method of my compartment
>> edit part, which is running in a read only transaction. Pressing apply
>> will then execute the change command inside a read transaction, which
>> causes this exception.
>>
>> For me it's unclear if this feature isn't fully implemented or if this
>> is a bug.
>>
>> Regards,
>> Matthias
Re: Transaction problem with SortFilterPage [message #16955 is a reply to message #16056] Mon, 14 August 2006 03:25 Go to previous messageGo to next message
Eclipse UserFriend
Hi Linda,

Thanks for your hints, but i think i didn't express the problem clearly
enough: i was taking about edit policy that are included in GMF and that
i want to utilize in my program. And there it looks like the design
recommendations that you have described are ignored, that's the reason
why i asked if this is a known bug or if i'm doing sth wrong.

Matthias

Linda Damus wrote:
> I should add that it would be even better if you could open the dialog
> from your action. When the user presses apply/ok, get the command from
> your edit policy and execute it. This has the advantage of separating
> the UI in the action from the semantic behaviour in the edit policy's
> command. That being said, it's not always possible to separate the two...
>
> Cheers,
> Linda
>
>
> Linda Damus wrote:
>
>> Hello Matthias,
>>
>> You could try returning a command from your edit policy that opens the
>> dialog when it is executed (from your action). #getCommand may be
>> called many times, but you probably don't want to make any model
>> changes until the command that is returned is actually executed.
>>
>> Hope that helps,
>> Linda
>>
>> Matthias Köster wrote:
>>
>>> Hi,
>>>
>>> After sucessfully adding my own SortFilterCompartmentEditPolicy and
>>> SortFilterContentPolicy, i can open the SortFilterDialog via the
>>> "Filters->Sort/Filter compartment items" context menu. So this opens
>>> the dialog and everything is shown correctly. But as soon as i press
>>> the apply or ok button, i get the following exception:
>>> org.eclipse.core.commands.ExecutionException: While executing the
>>> operation, an exception occurred
>>>
>>> at
>>> org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:517)
>>>
>>> at
>>> org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:206)
>>>
>>> at
>>> org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:169)
>>>
>>> at
>>> org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:156)
>>>
>>> at
>>> org.eclipse.gmf.runtime.diagram.ui.dialogs.sortfilter.SortFi lterPage.performApply(SortFilterPage.java:966)
>>>
>>> at
>>> org.eclipse.jface.preference.PreferencePage$2.widgetSelected (PreferencePage.java:282)
>>>
>>> at
>>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:90)
>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
>>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3164)
>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2840)
>>> at org.eclipse.jface.window.Window.runEventLoop(Window.java:820 )
>>> at org.eclipse.jface.window.Window.open(Window.java:796)
>>> at
>>> org.eclipse.gmf.runtime.diagram.ui.internal.dialogs.sortfilt er.SortFilterDialogUtil.invokeDialog(SortFilterDialogUtil.ja va:72)
>>>
>>> at
>>> org.eclipse.gmf.runtime.diagram.ui.editpolicies.SortFilterCo mpartmentItemsEditPolicy.getCommand(SortFilterCompartmentIte msEditPolicy.java:88)
>>>
>>> at
>>> org.eclipse.gef.editparts.AbstractEditPart.getCommand(Abstra ctEditPart.java:473)
>>>
>>> at
>>> org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.access$1(GraphicalEditPart.java:1)
>>>
>>> at
>>> org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt$1.run(GraphicalEditPart.java:414)
>>>
>>> at
>>> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.runExclusive(TransactionalEditingDomainImpl.java:258)
>>>
>>> at
>>> org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.getCommand(GraphicalEditPart.java:409)
>>>
>>> at
>>> org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.get Command(DiagramAction.java:175)
>>>
>>> at
>>> org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.get Command(DiagramAction.java:159)
>>>
>>> at
>>> org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.doR un(DiagramAction.java:101)
>>>
>>> at
>>> org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er.run(AbstractActionHandler.java:347)
>>>
>>> at
>>> org.eclipse.gmf.runtime.common.ui.action.ActionManager$1.run (ActionManager.java:225)
>>>
>>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
>>> at
>>> org.eclipse.gmf.runtime.common.ui.action.ActionManager.run(A ctionManager.java:223)
>>>
>>> at
>>> org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er.runWithEvent(AbstractActionHandler.java:365)
>>>
>>> at
>>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:539)
>>>
>>> at
>>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
>>>
>>> at
>>> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
>>>
>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
>>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3164)
>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2840)
>>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1914)
>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
>>> at
>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:419)
>>>
>>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>> at
>>> org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:95)
>>> at
>>> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
>>>
>>> at
>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
>>>
>>> at
>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
>>>
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
>>>
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
>>>
>>> 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:585)
>>> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
>>> at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
>>> at org.eclipse.core.launcher.Main.run(Main.java:977)
>>> at org.eclipse.core.launcher.Main.main(Main.java:952)
>>> Caused by: java.lang.IllegalStateException: Cannot activate
>>> read/write transaction in read-only transaction context
>>> at
>>> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.acquire(TransactionalEditingDomainImpl.java:498)
>>>
>>> at
>>> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.activate(TransactionalEditingDomainImpl.java:436)
>>>
>>> at
>>> org.eclipse.emf.transaction.impl.TransactionImpl.start(Trans actionImpl.java:154)
>>>
>>> at
>>> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.startTransaction(TransactionalEditingDomainImpl.java:352 )
>>>
>>> at
>>> org.eclipse.emf.workspace.AbstractEMFOperation.createTransac tion(AbstractEMFOperation.java:414)
>>>
>>> at
>>> org.eclipse.emf.workspace.AbstractEMFOperation.execute(Abstr actEMFOperation.java:124)
>>>
>>> at
>>> org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:509)
>>>
>>> ... 52 more
>>>
>>> Looks like we're still in the getCommand() method of my compartment
>>> edit part, which is running in a read only transaction. Pressing
>>> apply will then execute the change command inside a read transaction,
>>> which causes this exception.
>>>
>>> For me it's unclear if this feature isn't fully implemented or if
>>> this is a bug.
>>>
>>> Regards,
>>> Matthias
Re: Transaction problem with SortFilterPage [message #25259 is a reply to message #16955] Tue, 22 August 2006 04:58 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Does any body know if it's possible to use the SortFilterPage included
in GMF by adding your own SortFilterCompartmentEditPolicy and
SortFilterContentPolicy? I still wasn't able to get them running, as
described in my first post.

Regards,
Matthias

Matthias Köster wrote:
> Hi Linda,
>
> Thanks for your hints, but i think i didn't express the problem clearly
> enough: i was taking about edit policy that are included in GMF and that
> i want to utilize in my program. And there it looks like the design
> recommendations that you have described are ignored, that's the reason
> why i asked if this is a known bug or if i'm doing sth wrong.
>
> Matthias
>
> Linda Damus wrote:
>
>> I should add that it would be even better if you could open the dialog
>> from your action. When the user presses apply/ok, get the command
>> from your edit policy and execute it. This has the advantage of
>> separating the UI in the action from the semantic behaviour in the
>> edit policy's command. That being said, it's not always possible to
>> separate the two...
>>
>> Cheers,
>> Linda
>>
>>
>> Linda Damus wrote:
>>
>>> Hello Matthias,
>>>
>>> You could try returning a command from your edit policy that opens
>>> the dialog when it is executed (from your action). #getCommand may
>>> be called many times, but you probably don't want to make any model
>>> changes until the command that is returned is actually executed.
>>>
>>> Hope that helps,
>>> Linda
>>>
>>> Matthias Köster wrote:
>>>
>>>> Hi,
>>>>
>>>> After sucessfully adding my own SortFilterCompartmentEditPolicy and
>>>> SortFilterContentPolicy, i can open the SortFilterDialog via the
>>>> "Filters->Sort/Filter compartment items" context menu. So this opens
>>>> the dialog and everything is shown correctly. But as soon as i press
>>>> the apply or ok button, i get the following exception:
>>>> org.eclipse.core.commands.ExecutionException: While executing the
>>>> operation, an exception occurred
>>>>
>>>> at
>>>> org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:517)
>>>>
>>>> at
>>>> org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:206)
>>>>
>>>> at
>>>> org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:169)
>>>>
>>>> at
>>>> org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:156)
>>>>
>>>> at
>>>> org.eclipse.gmf.runtime.diagram.ui.dialogs.sortfilter.SortFi lterPage.performApply(SortFilterPage.java:966)
>>>>
>>>> at
>>>> org.eclipse.jface.preference.PreferencePage$2.widgetSelected (PreferencePage.java:282)
>>>>
>>>> at
>>>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:90)
>>>>
>>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
>>>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3164)
>>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2840)
>>>> at org.eclipse.jface.window.Window.runEventLoop(Window.java:820 )
>>>> at org.eclipse.jface.window.Window.open(Window.java:796)
>>>> at
>>>> org.eclipse.gmf.runtime.diagram.ui.internal.dialogs.sortfilt er.SortFilterDialogUtil.invokeDialog(SortFilterDialogUtil.ja va:72)
>>>>
>>>> at
>>>> org.eclipse.gmf.runtime.diagram.ui.editpolicies.SortFilterCo mpartmentItemsEditPolicy.getCommand(SortFilterCompartmentIte msEditPolicy.java:88)
>>>>
>>>> at
>>>> org.eclipse.gef.editparts.AbstractEditPart.getCommand(Abstra ctEditPart.java:473)
>>>>
>>>> at
>>>> org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.access$1(GraphicalEditPart.java:1)
>>>>
>>>> at
>>>> org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt$1.run(GraphicalEditPart.java:414)
>>>>
>>>> at
>>>> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.runExclusive(TransactionalEditingDomainImpl.java:258)
>>>>
>>>> at
>>>> org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.getCommand(GraphicalEditPart.java:409)
>>>>
>>>> at
>>>> org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.get Command(DiagramAction.java:175)
>>>>
>>>> at
>>>> org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.get Command(DiagramAction.java:159)
>>>>
>>>> at
>>>> org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.doR un(DiagramAction.java:101)
>>>>
>>>> at
>>>> org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er.run(AbstractActionHandler.java:347)
>>>>
>>>> at
>>>> org.eclipse.gmf.runtime.common.ui.action.ActionManager$1.run (ActionManager.java:225)
>>>>
>>>> at
>>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
>>>> at
>>>> org.eclipse.gmf.runtime.common.ui.action.ActionManager.run(A ctionManager.java:223)
>>>>
>>>> at
>>>> org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er.runWithEvent(AbstractActionHandler.java:365)
>>>>
>>>> at
>>>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:539)
>>>>
>>>> at
>>>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
>>>>
>>>> at
>>>> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
>>>>
>>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
>>>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3164)
>>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2840)
>>>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1914)
>>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
>>>> at
>>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:419)
>>>>
>>>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>>> at
>>>> org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:95)
>>>> at
>>>> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
>>>>
>>>> at
>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
>>>>
>>>> at
>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
>>>>
>>>> at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
>>>>
>>>> at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
>>>>
>>>> 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:585)
>>>> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
>>>> at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
>>>> at org.eclipse.core.launcher.Main.run(Main.java:977)
>>>> at org.eclipse.core.launcher.Main.main(Main.java:952)
>>>> Caused by: java.lang.IllegalStateException: Cannot activate
>>>> read/write transaction in read-only transaction context
>>>> at
>>>> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.acquire(TransactionalEditingDomainImpl.java:498)
>>>>
>>>> at
>>>> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.activate(TransactionalEditingDomainImpl.java:436)
>>>>
>>>> at
>>>> org.eclipse.emf.transaction.impl.TransactionImpl.start(Trans actionImpl.java:154)
>>>>
>>>> at
>>>> org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.startTransaction(TransactionalEditingDomainImpl.java:352 )
>>>>
>>>> at
>>>> org.eclipse.emf.workspace.AbstractEMFOperation.createTransac tion(AbstractEMFOperation.java:414)
>>>>
>>>> at
>>>> org.eclipse.emf.workspace.AbstractEMFOperation.execute(Abstr actEMFOperation.java:124)
>>>>
>>>> at
>>>> org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:509)
>>>>
>>>> ... 52 more
>>>>
>>>> Looks like we're still in the getCommand() method of my compartment
>>>> edit part, which is running in a read only transaction. Pressing
>>>> apply will then execute the change command inside a read
>>>> transaction, which causes this exception.
>>>>
>>>> For me it's unclear if this feature isn't fully implemented or if
>>>> this is a bug.
>>>>
>>>> Regards,
>>>> Matthias
Re: Transaction problem with SortFilterPage [message #26328 is a reply to message #25259] Tue, 22 August 2006 17:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cmahoney.ca.ibm.com

Matthias,

This seems to be a bug in GMF. I suggest you raise a bugzilla or you could
try to do this in a way that Linda suggests and submit the code. :-)

Regards,
Cherie

"Matthias K
Re: Transaction problem with SortFilterPage [message #28243 is a reply to message #26328] Thu, 24 August 2006 04:22 Go to previous message
Eclipse UserFriend
Hi Cherie,

I've created a new bugzilla Bug 154998 and attached a patch to it.

Regards,
Matthias Köster

Cherie Mahoney wrote:
> Matthias,
>
> This seems to be a bug in GMF. I suggest you raise a bugzilla or you could
> try to do this in a way that Linda suggests and submit the code. :-)
>
> Regards,
> Cherie
Previous Topic:Gmf documentation?
Next Topic:custom image
Goto Forum:
  


Current Time: Sat Jun 07 22:41:06 EDT 2025

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

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

Back to the top