Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Deleted view still showing(as a little crossed circle)
Deleted view still showing [message #502975] Thu, 10 December 2009 13:45 Go to next message
Olivier Marot is currently offline Olivier MarotFriend
Messages: 14
Registered: September 2009
Junior Member

I (obviously, given the title) have a problem with my GMF based editor.
To set up the context, we have three linked editors :
- a graphical editor based on GMF (and heavily customized),
- the EMF editor,
- a text editor based on TMF.

We kept the default generated behavior to link the editors.

The problem is, when deleting an element in another editor, the related view is not properly deleted.
In fact, it IS deleted by the semantic refresh of the xxxCanonicalEditPolicy, meaning its eContainer, element, children etc are set to null and it is not referenced by its parent view anymore.

Everything seems to be allright, but when going back to the diagram there is a gray crossed circle to the top left. A clic on this generates an exception :

Caused by: java.lang.NullPointerException
at adl.diagram.edit.policies.MindBaseItemSemanticEditPolicy.add DestroyShortcutsCommand( 289)
at adl.diagram.edit.policies.PrimitiveAnonymousSubComponentItem SemanticEditPolicy.getDestroyElementCommand(PrimitiveAnonymo
at adl.diagram.edit.policies.MindBaseItemSemanticEditPolicy.get SemanticCommandSwitch( 0)
at adl.diagram.edit.policies.MindBaseItemSemanticEditPolicy.get SemanticCommand(
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEdit Policy.getCommand(
at adl.diagram.edit.policies.MindBaseItemSemanticEditPolicy.get Command(
at org.eclipse.gef.editparts.AbstractEditPart.getCommand(Abstra
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.access$1(
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt$
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.runExclusive(
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.getCommand(
at adl.diagram.part.DeleteElementAction.getCommand(DeleteElemen
at org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.get Command(
at culateEnabled(
at org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.ref resh(
at org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er.selectionChanged(
at wer.flushSelectionEvents(
at wer$
at 5)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr
... 23 more

which is "normal" given that the view is not linked to the diagram root.
(PrimitiveAnonymousSubComponent is the deleted element)
What I don't understand is why this view is still present. I suppose it is still referenced somewhere, but I couldn't find where.

If it helps, here is some more info :
- this behavior is common to all elements
- this behavior is encountered even with all GMF custom code deactivated
- when clicking again another exception is raised :
at org.eclipse.gef.editparts.AbstractEditPart.getViewer(Abstrac
at t(
at :1064)
at va:544)
at org.eclipse.gef.EditDomain.mouseUp(
at Released(
at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(Li
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe
at org.eclipse.swt.widgets.EventTable.sendEvent( :84)
at org.eclipse.swt.widgets.Widget.sendEvent(
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch( :3473)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(
at org.eclipse.ui.internal.Workbench.access$4( 21)
at org.eclipse.ui.internal.Workbench$
at org.eclipse.core.databinding.observable.Realm.runWithDefault (
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework( 559)
at org.eclipse.equinox.launcher.Main.basicRun(
at org.eclipse.equinox.launcher.Main.main(

A "Delete from model" action does not cause this, so I thought the semantic refresh did not do all that it should do, but from what I found the delete from model is composed of a delete element command and a delete view command. But given that the element is already deleted and the semantic execute a delete view command, it may not.

I found this topic but I'm not sure it is the same problem.

These little circles are really annoying, and I'm out of ideas to solve this problem so I would be really thankful if someone could give me some hint.

Re: Deleted view still showing [message #508411 is a reply to message #502975] Mon, 18 January 2010 16:57 Go to previous message
Olivier Marot is currently offline Olivier MarotFriend
Messages: 14
Registered: September 2009
Junior Member

Do you have any news on this issue ?

Previous Topic:How to add bendpoints to a connection
Next Topic:Refresh error decoration with live validation
Goto Forum:

Current Time: Sat Apr 17 08:18:17 GMT 2021

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

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

Back to the top