Home » Modeling » GMF (Graphical Modeling Framework) » Drag and Drop Between Two Editing Panes
Drag and Drop Between Two Editing Panes [message #148920] |
Tue, 04 September 2007 15:50  |
Eclipse User |
|
|
|
Originally posted by: jdente.21technologies.com
Hi,
How do we enable drag and drop between multiple GMF editors? I've been
working for a while on trying to implement drag and drop between different
graphical editing panes in GMF-2.0 and Eclipse-3.3. For example, using the
Logic diagram example online, if I have two diagrams logic1 and logic2, I
would like to be able to drag and drop sets of logic gates, connections,
etc, from logic1 onto logic2.
As a first step, I figured out how to enable UUIDs, which allowed me to
cut/copy/paste between two or more diagrams. I then began experimenting
with drag and drop. I immediately ran into problems with drag and drop
because the default behavior of auto-expanding/scrolling the current canvas
does not let drag and drop move between editors. I created
DropSourceListeners and DropTargetListeners and registered them with my
DiagramEditor in initializeGraphicalViewer(). These listeners attempted to
override the auto-expand behavior found in
AbstractTransferDropTargetListener. I have also added a drag and drop edit
policy on the EditPart that contains all of the elements I wish to drag and
drop. I can see output and logging from all of these different components,
so I know that they registered correctly and are being called. However, I
still cannot remove the auto-expand/scroll behavior on drag and drop
actions.
I have the following questions:
1) What do I need to extend or modify in order to disable the
auto-expand/scroll behavior that is preventing me from dragging from one
editor to another? The AbstractTransferDropTargetListener seems to control
a lot of the auto-expand behavior. However, I also see a lot of code
pertaining to drag and drop auto-expand/target-viewer operations in the
SelectionTool code and the DragTracker code. Where is the default drag and
drop behavior coming from and how do I override it?
2) Which EditPolicy do I use with my EditPart? Initially, I used
DiagramDragDropEditPolicy, but this class throws class cast exceptions
whenever it is used. The getDropObjectsCommand attempts to cast the
selected objects (EditParts) to EObjects. I extended this class as a
temporary fix, but I do not believe my class is working correctly.
3) Which Transfer should I be using in my DragSourceListener? Currently I am
using LocalSelectionTransfer, which seems correct.
4) Can these modifications be performed using extension points so that I do
not need to modify generated code? I was able to change the EditPolicy
using an extension, but I have not been able to register new DragSource and
DropTarget Listeners using extensions. There appears to be an extension
point to register new DND extensions
(org.eclipse.gmf.runtime.common.ui.services.dnd.dragDropList enerProviders
and
org.eclipse.gmf.runtime.common.ui.services.dnd.transferAdapt erProviders),
but I cannot get these extension points to work and I cannot find any
documentation or information online.
I have found a couple of posts in mailing lists and forums about enabling
drag and drop between editors in GEF and GMF, but none of the threads fully
solved my problems.
Thanks,
Joe
|
|
|
Re: Drag and Drop Between Two Editing Panes [message #149473 is a reply to message #148920] |
Fri, 07 September 2007 11:44   |
Eclipse User |
|
|
|
Originally posted by: jdente.21technologies.com
Does anybody have any information with regards to drag and drop between
editors? We are scoping an upcoming project and need to know if drag and
drop between editors is feasible. Copy and paste between editors will get
the job done, but drag and drop is so much better.
Thanks,
Joe
"Joe Dente" <jdente@21technologies.com> wrote in message
news:fbkcts$s8s$1@build.eclipse.org...
> Hi,
>
> How do we enable drag and drop between multiple GMF editors? I've been
> working for a while on trying to implement drag and drop between different
> graphical editing panes in GMF-2.0 and Eclipse-3.3. For example, using
> the Logic diagram example online, if I have two diagrams logic1 and
> logic2, I would like to be able to drag and drop sets of logic gates,
> connections, etc, from logic1 onto logic2.
>
> As a first step, I figured out how to enable UUIDs, which allowed me to
> cut/copy/paste between two or more diagrams. I then began experimenting
> with drag and drop. I immediately ran into problems with drag and drop
> because the default behavior of auto-expanding/scrolling the current
> canvas does not let drag and drop move between editors. I created
> DropSourceListeners and DropTargetListeners and registered them with my
> DiagramEditor in initializeGraphicalViewer(). These listeners attempted
> to override the auto-expand behavior found in
> AbstractTransferDropTargetListener. I have also added a drag and drop
> edit policy on the EditPart that contains all of the elements I wish to
> drag and drop. I can see output and logging from all of these different
> components, so I know that they registered correctly and are being called.
> However, I still cannot remove the auto-expand/scroll behavior on drag and
> drop actions.
>
> I have the following questions:
>
> 1) What do I need to extend or modify in order to disable the
> auto-expand/scroll behavior that is preventing me from dragging from one
> editor to another? The AbstractTransferDropTargetListener seems to
> control a lot of the auto-expand behavior. However, I also see a lot of
> code pertaining to drag and drop auto-expand/target-viewer operations in
> the SelectionTool code and the DragTracker code. Where is the default
> drag and drop behavior coming from and how do I override it?
>
> 2) Which EditPolicy do I use with my EditPart? Initially, I used
> DiagramDragDropEditPolicy, but this class throws class cast exceptions
> whenever it is used. The getDropObjectsCommand attempts to cast the
> selected objects (EditParts) to EObjects. I extended this class as a
> temporary fix, but I do not believe my class is working correctly.
>
> 3) Which Transfer should I be using in my DragSourceListener? Currently I
> am using LocalSelectionTransfer, which seems correct.
>
> 4) Can these modifications be performed using extension points so that I
> do not need to modify generated code? I was able to change the EditPolicy
> using an extension, but I have not been able to register new DragSource
> and DropTarget Listeners using extensions. There appears to be an
> extension point to register new DND extensions
> (org.eclipse.gmf.runtime.common.ui.services.dnd.dragDropList enerProviders
> and
> org.eclipse.gmf.runtime.common.ui.services.dnd.transferAdapt erProviders),
> but I cannot get these extension points to work and I cannot find any
> documentation or information online.
>
> I have found a couple of posts in mailing lists and forums about enabling
> drag and drop between editors in GEF and GMF, but none of the threads
> fully solved my problems.
>
> Thanks,
> Joe
>
|
|
|
Re: Drag and Drop Between Two Editing Panes [message #149702 is a reply to message #149473] |
Mon, 10 September 2007 08:09   |
Eclipse User |
|
|
|
Hi Joe,
I have no particular solution for you, but you might consider starting
with this article to get a basic information:
http://www.eclipse.org/articles/Article-GEF-dnd/GEF-dnd.html
Joe Dente schrieb:
> Does anybody have any information with regards to drag and drop between
> editors? We are scoping an upcoming project and need to know if drag and
> drop between editors is feasible. Copy and paste between editors will get
> the job done, but drag and drop is so much better.
> Thanks,
> Joe
>
> "Joe Dente" <jdente@21technologies.com> wrote in message
> news:fbkcts$s8s$1@build.eclipse.org...
>> Hi,
>>
>> How do we enable drag and drop between multiple GMF editors? I've been
>> working for a while on trying to implement drag and drop between different
>> graphical editing panes in GMF-2.0 and Eclipse-3.3. For example, using
>> the Logic diagram example online, if I have two diagrams logic1 and
>> logic2, I would like to be able to drag and drop sets of logic gates,
>> connections, etc, from logic1 onto logic2.
>>
>> As a first step, I figured out how to enable UUIDs, which allowed me to
>> cut/copy/paste between two or more diagrams. I then began experimenting
>> with drag and drop. I immediately ran into problems with drag and drop
>> because the default behavior of auto-expanding/scrolling the current
>> canvas does not let drag and drop move between editors. I created
>> DropSourceListeners and DropTargetListeners and registered them with my
>> DiagramEditor in initializeGraphicalViewer(). These listeners attempted
>> to override the auto-expand behavior found in
>> AbstractTransferDropTargetListener. I have also added a drag and drop
>> edit policy on the EditPart that contains all of the elements I wish to
>> drag and drop. I can see output and logging from all of these different
>> components, so I know that they registered correctly and are being called.
>> However, I still cannot remove the auto-expand/scroll behavior on drag and
>> drop actions.
>>
>> I have the following questions:
>>
>> 1) What do I need to extend or modify in order to disable the
>> auto-expand/scroll behavior that is preventing me from dragging from one
>> editor to another? The AbstractTransferDropTargetListener seems to
>> control a lot of the auto-expand behavior. However, I also see a lot of
>> code pertaining to drag and drop auto-expand/target-viewer operations in
>> the SelectionTool code and the DragTracker code. Where is the default
>> drag and drop behavior coming from and how do I override it?
>>
>> 2) Which EditPolicy do I use with my EditPart? Initially, I used
>> DiagramDragDropEditPolicy, but this class throws class cast exceptions
>> whenever it is used. The getDropObjectsCommand attempts to cast the
>> selected objects (EditParts) to EObjects. I extended this class as a
>> temporary fix, but I do not believe my class is working correctly.
>>
>> 3) Which Transfer should I be using in my DragSourceListener? Currently I
>> am using LocalSelectionTransfer, which seems correct.
>>
>> 4) Can these modifications be performed using extension points so that I
>> do not need to modify generated code? I was able to change the EditPolicy
>> using an extension, but I have not been able to register new DragSource
>> and DropTarget Listeners using extensions. There appears to be an
>> extension point to register new DND extensions
>> (org.eclipse.gmf.runtime.common.ui.services.dnd.dragDropList enerProviders
>> and
>> org.eclipse.gmf.runtime.common.ui.services.dnd.transferAdapt erProviders),
>> but I cannot get these extension points to work and I cannot find any
>> documentation or information online.
>>
>> I have found a couple of posts in mailing lists and forums about enabling
>> drag and drop between editors in GEF and GMF, but none of the threads
>> fully solved my problems.
>>
>> Thanks,
>> Joe
>>
>
>
|
|
|
Re: Drag and Drop Between Two Editing Panes [message #150117 is a reply to message #149702] |
Tue, 11 September 2007 11:37   |
Eclipse User |
|
|
|
Originally posted by: jdente.21technologies.com
Thanks for the response.
I have seen this article and several others online. I do not have a problem
implementing drag and drop behavior on a single editor or even from a view
to an editor. I am simply having problems implementing DND between two
editors. The only reason DND between two editors is difficult for me to
implement, is because of the default drag and drop semantics where the
editors auto-expand and auto-scroll when the dragging cursor moves off the
edge of the editor. When dragging an object off of the source editor onto a
target editor, I need the drop target to switch to the new editor. I cannot
determine how to override the default auto-expand / scroll behavior of an
editor.
Thanks for the help,
Joe.
"Axel Guckelsberger" <info@guite.de> wrote in message
news:fc3c52$pn5$1@build.eclipse.org...
> Hi Joe,
>
> I have no particular solution for you, but you might consider starting
> with this article to get a basic information:
> http://www.eclipse.org/articles/Article-GEF-dnd/GEF-dnd.html
>
>
> Joe Dente schrieb:
>> Does anybody have any information with regards to drag and drop between
>> editors? We are scoping an upcoming project and need to know if drag and
>> drop between editors is feasible. Copy and paste between editors will
>> get
>> the job done, but drag and drop is so much better.
>> Thanks,
>> Joe
>>
>> "Joe Dente" <jdente@21technologies.com> wrote in message
>> news:fbkcts$s8s$1@build.eclipse.org...
>>> Hi,
>>>
>>> How do we enable drag and drop between multiple GMF editors? I've
>>> been
>>> working for a while on trying to implement drag and drop between
>>> different
>>> graphical editing panes in GMF-2.0 and Eclipse-3.3. For example, using
>>> the Logic diagram example online, if I have two diagrams logic1 and
>>> logic2, I would like to be able to drag and drop sets of logic gates,
>>> connections, etc, from logic1 onto logic2.
>>>
>>> As a first step, I figured out how to enable UUIDs, which allowed me
>>> to
>>> cut/copy/paste between two or more diagrams. I then began experimenting
>>> with drag and drop. I immediately ran into problems with drag and drop
>>> because the default behavior of auto-expanding/scrolling the current
>>> canvas does not let drag and drop move between editors. I created
>>> DropSourceListeners and DropTargetListeners and registered them with my
>>> DiagramEditor in initializeGraphicalViewer(). These listeners attempted
>>> to override the auto-expand behavior found in
>>> AbstractTransferDropTargetListener. I have also added a drag and drop
>>> edit policy on the EditPart that contains all of the elements I wish to
>>> drag and drop. I can see output and logging from all of these different
>>> components, so I know that they registered correctly and are being
>>> called.
>>> However, I still cannot remove the auto-expand/scroll behavior on drag
>>> and
>>> drop actions.
>>>
>>> I have the following questions:
>>>
>>> 1) What do I need to extend or modify in order to disable the
>>> auto-expand/scroll behavior that is preventing me from dragging from one
>>> editor to another? The AbstractTransferDropTargetListener seems to
>>> control a lot of the auto-expand behavior. However, I also see a lot of
>>> code pertaining to drag and drop auto-expand/target-viewer operations in
>>> the SelectionTool code and the DragTracker code. Where is the default
>>> drag and drop behavior coming from and how do I override it?
>>>
>>> 2) Which EditPolicy do I use with my EditPart? Initially, I used
>>> DiagramDragDropEditPolicy, but this class throws class cast exceptions
>>> whenever it is used. The getDropObjectsCommand attempts to cast the
>>> selected objects (EditParts) to EObjects. I extended this class as a
>>> temporary fix, but I do not believe my class is working correctly.
>>>
>>> 3) Which Transfer should I be using in my DragSourceListener? Currently
>>> I
>>> am using LocalSelectionTransfer, which seems correct.
>>>
>>> 4) Can these modifications be performed using extension points so that I
>>> do not need to modify generated code? I was able to change the
>>> EditPolicy
>>> using an extension, but I have not been able to register new DragSource
>>> and DropTarget Listeners using extensions. There appears to be an
>>> extension point to register new DND extensions
>>> (org.eclipse.gmf.runtime.common.ui.services.dnd.dragDropList enerProviders
>>> and
>>> org.eclipse.gmf.runtime.common.ui.services.dnd.transferAdapt erProviders),
>>> but I cannot get these extension points to work and I cannot find any
>>> documentation or information online.
>>>
>>> I have found a couple of posts in mailing lists and forums about
>>> enabling
>>> drag and drop between editors in GEF and GMF, but none of the threads
>>> fully solved my problems.
>>>
>>> Thanks,
>>> Joe
>>>
>>
>>
|
|
|
Re: Drag and Drop Between Two Editing Panes [message #152002 is a reply to message #149702] |
Sat, 22 September 2007 17:13  |
Eclipse User |
|
|
|
Originally posted by: Sam.sam.sam
Hi Axel,
thx for the hint and the link. it works in so far, that you are able to drag
a resource from the view or even the OS and drop it on the diagram. but the
part will not be added to the diagram. i think, this is why:
GEF GMF
CreateCommand CreateElementCommand
TargetDropListener(SWT) ResourceDropTargetListener
unfortunately, the classes used in GMF are not extending or implementing the
same interfaces like the GEF-classes do. there is no chance to add a
ResourceDropTargetListener to the DiagramEditorPart!
Sam
"Axel Guckelsberger" <info@guite.de> schrieb im Newsbeitrag
news:fc3c52$pn5$1@build.eclipse.org...
> Hi Joe,
>
> I have no particular solution for you, but you might consider starting
> with this article to get a basic information:
> http://www.eclipse.org/articles/Article-GEF-dnd/GEF-dnd.html
>
>
> Joe Dente schrieb:
>> Does anybody have any information with regards to drag and drop between
>> editors? We are scoping an upcoming project and need to know if drag and
>> drop between editors is feasible. Copy and paste between editors will
>> get
>> the job done, but drag and drop is so much better.
>> Thanks,
>> Joe
>>
>> "Joe Dente" <jdente@21technologies.com> wrote in message
>> news:fbkcts$s8s$1@build.eclipse.org...
>>> Hi,
>>>
>>> How do we enable drag and drop between multiple GMF editors? I've
>>> been
>>> working for a while on trying to implement drag and drop between
>>> different
>>> graphical editing panes in GMF-2.0 and Eclipse-3.3. For example, using
>>> the Logic diagram example online, if I have two diagrams logic1 and
>>> logic2, I would like to be able to drag and drop sets of logic gates,
>>> connections, etc, from logic1 onto logic2.
>>>
>>> As a first step, I figured out how to enable UUIDs, which allowed me
>>> to
>>> cut/copy/paste between two or more diagrams. I then began experimenting
>>> with drag and drop. I immediately ran into problems with drag and drop
>>> because the default behavior of auto-expanding/scrolling the current
>>> canvas does not let drag and drop move between editors. I created
>>> DropSourceListeners and DropTargetListeners and registered them with my
>>> DiagramEditor in initializeGraphicalViewer(). These listeners attempted
>>> to override the auto-expand behavior found in
>>> AbstractTransferDropTargetListener. I have also added a drag and drop
>>> edit policy on the EditPart that contains all of the elements I wish to
>>> drag and drop. I can see output and logging from all of these different
>>> components, so I know that they registered correctly and are being
>>> called.
>>> However, I still cannot remove the auto-expand/scroll behavior on drag
>>> and
>>> drop actions.
>>>
>>> I have the following questions:
>>>
>>> 1) What do I need to extend or modify in order to disable the
>>> auto-expand/scroll behavior that is preventing me from dragging from one
>>> editor to another? The AbstractTransferDropTargetListener seems to
>>> control a lot of the auto-expand behavior. However, I also see a lot of
>>> code pertaining to drag and drop auto-expand/target-viewer operations in
>>> the SelectionTool code and the DragTracker code. Where is the default
>>> drag and drop behavior coming from and how do I override it?
>>>
>>> 2) Which EditPolicy do I use with my EditPart? Initially, I used
>>> DiagramDragDropEditPolicy, but this class throws class cast exceptions
>>> whenever it is used. The getDropObjectsCommand attempts to cast the
>>> selected objects (EditParts) to EObjects. I extended this class as a
>>> temporary fix, but I do not believe my class is working correctly.
>>>
>>> 3) Which Transfer should I be using in my DragSourceListener? Currently
>>> I
>>> am using LocalSelectionTransfer, which seems correct.
>>>
>>> 4) Can these modifications be performed using extension points so that I
>>> do not need to modify generated code? I was able to change the
>>> EditPolicy
>>> using an extension, but I have not been able to register new DragSource
>>> and DropTarget Listeners using extensions. There appears to be an
>>> extension point to register new DND extensions
>>> (org.eclipse.gmf.runtime.common.ui.services.dnd.dragDropList enerProviders
>>> and
>>> org.eclipse.gmf.runtime.common.ui.services.dnd.transferAdapt erProviders),
>>> but I cannot get these extension points to work and I cannot find any
>>> documentation or information online.
>>>
>>> I have found a couple of posts in mailing lists and forums about
>>> enabling
>>> drag and drop between editors in GEF and GMF, but none of the threads
>>> fully solved my problems.
>>>
>>> Thanks,
>>> Joe
>>>
>>
>>
|
|
|
Goto Forum:
Current Time: Thu May 08 10:32:44 EDT 2025
Powered by FUDForum. Page generated in 0.04488 seconds
|