Extending GWT Designer:How to DragDrop from custom ViewPart

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Extending GWT Designer:How to DragDrop from custom ViewPart

Postby dexpad » Wed May 04, 2011 8:33 pm


I have a custom org.eclipse.ui.part.ViewPart with a TreeViewer in it.
I want to be able to drag and drop tree nodes onto the GWT Designer's DiagramEditor.
On drop, a GWT label and TextField should get created in the GWT Designer's DiagramEditor.
Can you tell me if this is possible and provide some guidance on how this can be done.
I am familiar with GEF and Eclipse plugin development (not an 'expert' though).

Posts: 1
Joined: Wed May 04, 2011 8:23 pm

Re: Extending GWT Designer:How to DragDrop from custom ViewP

Postby Konstantin.Scheglov » Wed May 11, 2011 6:25 am

WindowBuilder does not support directly external DND.
But you can try to find active org.eclipse.wb.internal.core.editor.multi.DesignerEditor, get (in hackish way) EditEditDomain and set CreationTool which you want.
To install externally LayoutEditPolicy, which will accept your Tool, you can use org.eclipse.wb.core.gef.IEditPartConfigurator via org.eclipse.wb.core.editPartConfigurators extension point. See org.eclipse.wb.internal.swing.gef.policy.action.ActionDropPolicyConfigurator as example.

Actual adding of Label and TextField depends on target Panel you want to add them to. In general you should use org.eclipse.wb.internal.core.model.JavaInfoUtils.createJavaInfo(AstEditor, String, CreationSupport) to create model and then use FlowContainer or generic org.eclipse.wb.internal.core.model.JavaInfoUtils.add(JavaInfo, AssociationObject, JavaInfo, JavaInfo) to add new children to parent.
Posts: 186
Joined: Tue Oct 18, 2005 8:11 pm
Location: Russian Federation, Lipetsk

Return to GWT Designer

Who is online

Users browsing this forum: No registered users and 2 guests