Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Drag and Drop Objects from Navigator to other Editor(An internal error occurred during: "Decoration Calculation".)
Drag and Drop Objects from Navigator to other Editor [message #507110] Tue, 12 January 2010 03:47 Go to next message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
ne Problem-> see post # 3
Hello,
I have two Editors based on GEF. The first is almost finished and works fine. Now I need some links in the second Editor to objects in the first editor.Therefore I need DnD support.
My Navigator shows all the objects of editor 1 in a tree. Now I want to drag an object from this tree and drop it in the second editor.
What I did was adding a CommonDragAdapterAssistant to my Navigator View and a AbstractTransferDropTargetListener to the graphicalViewer of the second editor.

The problem is that the AbstractTransferDropTargetListener class does not respond on any drop actions, but I don't know why.

So I would appreciate any help, perhaps the way I am trying is completly wrong so any advice would be helpful Smile

Best regards
Alex

[Updated on: Mon, 18 January 2010 11:34]

Report message to a moderator

Re: Drag and Drop Objects from Navigator to other Editor [message #507394 is a reply to message #507110] Wed, 13 January 2010 11:07 Go to previous messageGo to next message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Hello again Smile
I solved the problem:
I just had to introduce my own Transfer Object and make the DropListener supporting that type of Transfer.

Now I am looking for an idea about deleting links.
If I drag an object to an other editor I want it being added as link, which means that if the original object is being deleted the link-object should be deleted just as well.

The problem is the two plugins.
Its not guaranteed that both editors are opened, which means if the link editor is closed I have no access to its objects (and the link object as well) and backwards.

Further for example renaming the name of the original object should be visible at the linked object, too.

Any ideas welcome Smile

Thanks in advance & best regards
Alex

[Updated on: Wed, 13 January 2010 11:15]

Report message to a moderator

Re: Drag and Drop Objects from Navigator to other Editor [message #508272 is a reply to message #507110] Mon, 18 January 2010 08:52 Go to previous message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
I solved the DND Problem, I just had to add the supportet Transfer Type to my Drop Listener.

But there is still one problem left:
Everything works fine, I can Drag and Drop Objects from the Navigator view to my editor. But if the Property View is opened, nothing works. I do not really know how to solve because no one of my classes is invoked...
The Exceptions are thrown, directly after selecting an model object in my own navigator view:

An internal error occurred during: "Decoration Calculation".

org.eclipse.core.runtime.AssertionFailedException: assertion failed: 
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
	at org.eclipse.ui.internal.util.Util.getAdapter(Util.java:113)
	at org.eclipse.ui.internal.ActionExpression$ObjectStateExpression.getActionFilter(ActionExpression.java:471)
	at org.eclipse.ui.internal.ActionExpression$ObjectStateExpression.preciselyMatches(ActionExpression.java:524)
	at org.eclipse.ui.internal.ActionExpression$ObjectStateExpression.isEnabledFor(ActionExpression.java:499)
	at org.eclipse.ui.internal.ActionExpression$SingleExpression.isEnabledFor(ActionExpression.java:743)
	at org.eclipse.ui.internal.ActionExpression.isEnabledFor(ActionExpression.java:1053)
	at org.eclipse.ui.internal.decorators.DecoratorDefinition.isEnabledFor(DecoratorDefinition.java:281)
	at org.eclipse.ui.internal.decorators.DecoratorManager.getDecoratorsFor(DecoratorManager.java:382)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecoratorsFor(LightweightDecoratorManager.java:315)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:340)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:371)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:331)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

java.lang.ClassCastException: XYZ.ApplicationUnitPropertySource cannot be cast to org.eclipse.core.resources.IResource
	at org.eclipse.ui.ide.ResourceUtil.getResource(ResourceUtil.java:132)
	at org.eclipse.ui.internal.ide.actions.BuildUtilities.extractProjects(BuildUtilities.java:52)
	at org.eclipse.ui.internal.ide.actions.BuildUtilities.findSelectedProjects(BuildUtilities.java:81)
	at org.eclipse.ui.actions.BuildAction.isEnabled(BuildAction.java:231)
	at org.eclipse.ui.actions.RetargetAction.setActionHandler(RetargetAction.java:273)
	at org.eclipse.ui.internal.ide.actions.RetargetActionWithDefault.setActionHandler(RetargetActionWithDefault.java:47)
	at org.eclipse.ui.actions.RetargetAction.partActivated(RetargetAction.java:155)
	at org.eclipse.ui.internal.PartListenerList$1.run(PartListenerList.java:72)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.runtime.Platform.run(Platform.java:888)
	at org.eclipse.ui.internal.PartListenerList.fireEvent(PartListenerList.java:57)
	at org.eclipse.ui.internal.PartListenerList.firePartActivated(PartListenerList.java:70)
	at org.eclipse.ui.internal.PartService.firePartActivated(PartService.java:187)
	at org.eclipse.ui.internal.PartService.setActivePart(PartService.java:306)
	at org.eclipse.ui.internal.WWinPartService.updateActivePart(WWinPartService.java:131)
	at org.eclipse.ui.internal.WWinPartService.access$0(WWinPartService.java:122)
	at org.eclipse.ui.internal.WWinPartService$WWinListener.partDeactivated(WWinPartService.java:50)
	at org.eclipse.ui.internal.PartListenerList2$4.run(PartListenerList2.java:115)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.runtime.Platform.run(Platform.java:888)
	at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:55)
	at org.eclipse.ui.internal.PartListenerList2.firePartDeactivated(PartListenerList2.java:113)
	at org.eclipse.ui.internal.PartService.firePartDeactivated(PartService.java:242)
	at org.eclipse.ui.internal.PartService.setActivePart(PartService.java:300)
	at org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged(WorkbenchPagePartList.java:57)
	at org.eclipse.ui.internal.PartList.setActivePart(PartList.java:136)
	at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3531)
	at org.eclipse.ui.internal.WorkbenchPage.requestActivation(WorkbenchPage.java:3071)
	at org.eclipse.ui.internal.PartPane.requestActivation(PartPane.java:279)
	at org.eclipse.ui.internal.PartPane.handleEvent(PartPane.java:237)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1008)
	at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1404)
	at org.eclipse.swt.widgets.Shell.WM_MOUSEACTIVATE(Shell.java:2268)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:3989)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:342)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1578)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2010)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2404)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4036)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2404)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4036)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2404)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4036)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2404)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4036)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2404)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4036)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2404)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4036)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2404)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4036)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2404)
	at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:1439)
	at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:5722)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602)
	at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2312)
	at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:1530)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4036)
	at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:5821)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602)
	at org.eclipse.swt.internal.win32.OS.PeekMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.PeekMessage(OS.java:2974)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3468)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
	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:368)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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(Main.java:559)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1287)


[Updated on: Mon, 18 January 2010 09:30]

Report message to a moderator

Previous Topic:org.eclipse.gmf.runtime.draw2d* plugin
Next Topic:how to create edit part from code editor
Goto Forum:
  


Current Time: Thu Apr 25 12:01:32 GMT 2024

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

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

Back to the top