Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Problem while creating DiagramDocumentEditor as a drop target
Problem while creating DiagramDocumentEditor as a drop target [message #196991] Mon, 14 July 2008 20:01
Narendran Shanmugasundaram is currently offline Narendran ShanmugasundaramFriend
Messages: 5
Registered: July 2009
Junior Member
Hello All,

I am trying to assign the DiagramDocumentEditor (generated by GMF) as a
drop target for some custom tools in the fly-out palette (some of which
were added manually). I did an override of the
createPaletteViewerProvider method to make it a drag source:

protected PaletteViewerProvider createPaletteViewerProvider() {
super.createPaletteViewerProvider();
getEditDomain().setPaletteRoot(createPaletteRoot(null));
return new PaletteViewerProvider(getEditDomain()) {

public PaletteViewer createPaletteViewer(Composite parent) {
return super.createPaletteViewer(parent);
}
protected void configurePaletteViewer(PaletteViewer
viewer) {
super.configurePaletteViewer(viewer);
viewer.addDragSourceListener(new
TemplateTransferDragSourceListener(viewer));
}

};
}

I then did an override of the initializeGraphicalViewer method:

protected void initializeGraphicalViewer() {
super.initializeGraphicalViewer();


getDiagramGraphicalViewer().addDropTargetListener(new
TemplateTransferDropTargetListener(getGraphicalViewer()) {
protected CreationFactory getFactory(Object template) {
return new NodeCreationFactory((Class<?>)(template));
}
});


}

"NodeCreationFactory" is the name of my class which creates and returns
Objects based on the "template".

There is no problem when I drag and drop tools in the palette which were
generated by GMF. But the editor does not act as a drop target for the
tools which were manually added by me. Am I missing something here? Do I
have to implement/override some other method?

Thanks in advance.

Cheers,
Naren.
Previous Topic:Problems accessing subclasses in different packages
Next Topic:Context Menu in Mapping file
Goto Forum:
  


Current Time: Sat Jun 06 12:09:19 GMT 2020

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

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

Back to the top