Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357742

Summary: [modeling] (Remove support for..) Contained package decorations not shown in the expected place
Product: z_Archived Reporter: Steffen Pingel <steffen.pingel>
Component: MylynAssignee: Miles Parker <milesparker>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 0.9   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 357993    
Bug Blocks: 354787, 358489    
Attachments:
Description Flags
diagram editor none

Description Steffen Pingel CLA 2011-09-15 05:17:18 EDT
Steps:
1. Create ECore diagram
2. Activate task

A decoration appears in an unexpected location (see screenshot).
Comment 1 Steffen Pingel CLA 2011-09-15 05:17:40 EDT
Created attachment 203390 [details]
diagram editor
Comment 2 Steffen Pingel CLA 2011-09-15 05:18:37 EDT
This was in the log:

Ignoring provider org.eclipse.mylyn.internal.modeling.ecoretools.EcoreDiagramDecoratorProvider since it threw an exception or error in the provides() method

java.lang.NullPointerException
	at org.eclipse.mylyn.modeling.gmf.ContextDecoratorProvider.accepts(ContextDecoratorProvider.java:151)
	at org.eclipse.mylyn.modeling.gmf.ContextDecoratorProvider.accepts(ContextDecoratorProvider.java:149)
	at org.eclipse.mylyn.modeling.gmf.ContextDecoratorProvider.provides(ContextDecoratorProvider.java:136)
	at org.eclipse.gmf.runtime.diagram.ui.internal.services.decorator.DecoratorService$ProviderDescriptor.provides(DecoratorService.java:76)
	at org.eclipse.gmf.runtime.common.core.service.Service.safeProvides(Service.java:859)
	at org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy.getUncachedProviders(ExecutionStrategy.java:254)
	at org.eclipse.gmf.runtime.common.core.service.Service.getProviders(Service.java:537)
	at org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy$4.execute(ExecutionStrategy.java:178)
	at org.eclipse.gmf.runtime.common.core.service.Service.execute(Service.java:651)
	at org.eclipse.gmf.runtime.diagram.ui.internal.services.decorator.DecoratorService.createDecorators(DecoratorService.java:121)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.DecorationEditPolicy.activate(DecorationEditPolicy.java:201)
	at org.eclipse.gef.editparts.AbstractEditPart.activateEditPolicies(AbstractEditPart.java:174)
	at org.eclipse.gef.editparts.AbstractEditPart.activate(AbstractEditPart.java:156)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.activate(AbstractGraphicalEditPart.java:195)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart.activate(ConnectionEditPart.java:257)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.addSourceConnection(AbstractGraphicalEditPart.java:262)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refreshSourceConnections(AbstractGraphicalEditPart.java:697)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart.handleNotificationEvent(ShapeNodeEditPart.java:227)
	at org.eclipse.emf.ecoretools.diagram.edit.parts.EClass2EditPart.handleNotificationEvent(EClass2EditPart.java:450)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.notifyChanged(GraphicalEditPart.java:1438)
	at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker.fireNotification(DiagramEventBroker.java:500)
	at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker.resourceSetChanged(DiagramEventBroker.java:395)
	at org.eclipse.gmf.runtime.diagram.ui.DiagramEventBrokerThreadSafe.resourceSetChanged(DiagramEventBrokerThreadSafe.java:73)
	at org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory$DiagramEditingDomain.postcommit(DiagramEditingDomainFactory.java:214)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.deactivate(TransactionalEditingDomainImpl.java:543)
	at org.eclipse.emf.transaction.impl.TransactionImpl.close(TransactionImpl.java:712)
	at org.eclipse.emf.transaction.impl.TransactionImpl.commit(TransactionImpl.java:474)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:155)
	at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403)
	at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
	at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403)
	at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
	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.gef.tools.AbstractTool.executeCommand(AbstractTool.java:425)
	at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:438)
	at org.eclipse.gmf.runtime.diagram.ui.tools.ConnectionCreationTool.handleCreateConnection(ConnectionCreationTool.java:342)
	at org.eclipse.gmf.runtime.diagram.ui.tools.ConnectionCreationTool.handleButtonUp(ConnectionCreationTool.java:182)
	at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1200)
	at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:301)
	at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:380)
	at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:219)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Comment 3 Miles Parker CLA 2011-09-15 13:29:53 EDT
COuld you send me your example model? I haven't actually played with different background colors much.
Comment 4 Steffen Pingel CLA 2011-09-15 14:23:46 EDT
I'll send you the workspace. It was a very simple project with two classes (as shown in the screenshot).
Comment 5 Miles Parker CLA 2011-09-15 18:38:47 EDT
OK, this is for a case that I'm afraid to say I hadn't even considered -- namely contained packages in the diagram itself. Often these are flat in the model. The good news looks like it might explain a number of things that are going wrong.
Comment 6 Miles Parker CLA 2011-09-15 19:34:48 EDT
OK, I've looked into this a bit.. There seem to be some pretty funky issues with packages within ecore diagrams. I've never used them this way, and I don't think most people do.. Instead we tend to have different ecorediag files for each package. See for example: bug 149547  bug 165866. I tried one simple way of dealing with this and it was semi-successful, but it ended up breaking some other stuff. There will be a fair amount of fixes involved for functionality that isn't used that much. The other issue is that packages are drawn with gradient background, which our technique doesn't work perfectly with.

This issue will come up with other compartment type models, probably, but it is a pretty significant set of tasks. So.. I know this is weak, but I'm inclined to consider not supporting focusing for internal compartments (i.e. packages) at this point and revisit later. Thoughts?
Comment 7 Steffen Pingel CLA 2011-09-16 05:04:52 EDT
Sounds reasonable to me. Please feel free to mark this as an enhancement and move it to the appropriate place. Please list this limitation somewhere on the Wiki page.
Comment 8 Miles Parker CLA 2011-09-21 16:36:24 EDT
I'm making this represent just graceful non-support for package level so that we don't get any exceptions like the one above.
Comment 9 Miles Parker CLA 2011-09-23 21:10:47 EDT
Should be working. Packages as a whole are faded, but interior classes for those packages are not.