DND [message #115238] |
Mon, 02 February 2004 12:03  |
Eclipse User |
|
|
|
Originally posted by: cjmanju.yahoo.com
I have added the dnd listener in the initializeGraphicalViewer()
getGraphicalViewer().addDropTargetListener(
new FormTemplateTransferDropTargetListener(getGraphicalViewer()) );
But the getFactory() method in the listener is not being called when i
click on an item in the palette and drop it onto the editor. So, nothing
happens. What am i missing?
I have set up everything similar to the logicdesign example. I have a
GraphicalPartFactory linked with the viewer
protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
ScrollingGraphicalViewer viewer =
(ScrollingGraphicalViewer)getGraphicalViewer();
ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart();
viewer.setRootEditPart(root);
viewer.setEditPartFactory(new GraphicalPartFactory());
}
Here is the palette entry
combined = new CombinedTemplateCreationEntry(
"label",
"creates a label",
"Label",
new SimpleFactory(FormLabel.class),
ImageDescriptor.createFromFile(Editor.class, "icons/label16.gif"),
ImageDescriptor.createFromFile(Editor.class, "icons/label24.gif")
);
Thanks
Manju
|
|
|
Re: DND [message #115315 is a reply to message #115238] |
Tue, 03 February 2004 09:54  |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Manju wrote:
> I have added the dnd listener in the initializeGraphicalViewer()
>
> getGraphicalViewer().addDropTargetListener(
> new FormTemplateTransferDropTargetListener(getGraphicalViewer()) );
>
> But the getFactory() method in the listener is not being called when i
> click on an item in the palette and drop it onto the editor. So, nothing
> happens. What am i missing?
>
> I have set up everything similar to the logicdesign example. I have a
> GraphicalPartFactory linked with the viewer
> protected void configureGraphicalViewer() {
> super.configureGraphicalViewer();
> ScrollingGraphicalViewer viewer =
> (ScrollingGraphicalViewer)getGraphicalViewer();
> ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart();
> viewer.setRootEditPart(root);
> viewer.setEditPartFactory(new GraphicalPartFactory());
> }
>
> Here is the palette entry
> combined = new CombinedTemplateCreationEntry(
> "label",
> "creates a label",
> "Label",
> new SimpleFactory(FormLabel.class),
> ImageDescriptor.createFromFile(Editor.class, "icons/label16.gif"),
> ImageDescriptor.createFromFile(Editor.class, "icons/label24.gif")
> );
>
> Thanks
> Manju
>
>
>
did you add the dragsource listener to the pallette?
--
Respectfully,
CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber." John 10:1
GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D
For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
|
|
|
Powered by
FUDForum. Page generated in 0.22542 seconds