Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Need meta key info
Need meta key info [message #172589] Sat, 19 March 2005 16:55 Go to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

I need to know what keys are being held down during a TemplateDrop
action, and also during a paste action. The past action is my own
action and command, but how to I know what keys are held down, and at
which point would you recommend me capturing that info?


The TemplateDrop seems to be limited to Drop Copy only, but I want a
DropLink. Any idea on how I should go about getting that?

Looks like we have a whole new duplicated DropTargetListener here
instead of the one used normally by Java. Its confusing me a bit as to
how I should proceed!?


Thanks for tips and direction,



CL
Re: Need meta key info [message #172694 is a reply to message #172589] Mon, 21 March 2005 15:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> wrote in message
news:d1hlhb$hvn$1@www.eclipse.org...
>I need to know what keys are being held down during a TemplateDrop action,
>and also during a paste action. The past action is my own action and
>command, but how to I know what keys are held down, and at which point
>would you recommend me capturing that info?
>
>
> The TemplateDrop seems to be limited to Drop Copy only, but I want a
> DropLink. Any idea on how I should go about getting that?

See handleDragOperationChanged. COPY is set there. A link would suggest
that the created item links back to a single instance of the template.
i.e., changing the template would update all dropped instances of that
template.

> Looks like we have a whole new duplicated DropTargetListener here instead
> of the one used normally by Java.

What does that mean? The drop listener is determined by the windowing
toolkit, and java has many such toolkits available. In the case of GEF, we
use a jface utility class which is derived from the SWT interface.
Re: Need meta key info [message #172716 is a reply to message #172694] Mon, 21 March 2005 15:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

Randy Hudson wrote:
> "CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> wrote in message
> news:d1hlhb$hvn$1@www.eclipse.org...
>
>>I need to know what keys are being held down during a TemplateDrop action,
>>and also during a paste action. The past action is my own action and
>>command, but how to I know what keys are held down, and at which point
>>would you recommend me capturing that info?
>>
>>
>>The TemplateDrop seems to be limited to Drop Copy only, but I want a
>>DropLink. Any idea on how I should go about getting that?
>
>
> See handleDragOperationChanged. COPY is set there. A link would suggest
> that the created item links back to a single instance of the template.
> i.e., changing the template would update all dropped instances of that
> template.
>

Well a Link would imply dropped instances to be linked. Thats what I am
looking to imply, though linking means not necessarily what you
specified in the context of my application.

Because their is the idea of 'linking' and my app uses 'linking' I want
to stay consistent with the method the user would normally use when
dropping something and trying to create a link.

I say the COPY set there. But the listener seems to be completely aware
that the only action would be copy. So I fear the change will be more
complicated.





>
>>Looks like we have a whole new duplicated DropTargetListener here instead
>>of the one used normally by Java.
>
>
> What does that mean? The drop listener is determined by the windowing
> toolkit, and java has many such toolkits available. In the case of GEF, we
> use a jface utility class which is derived from the SWT interface.
>

I see. I guess I had used the awt system before and was used to it.
Now I gotta get a feel for this swt one which is slightly different.
Like when dropActionChanged() is called, how do I get an indication of
what it was changed to? in the awt system, there is an event object
passed into this method and you can tell from that. But here there is
no way to know, nor reject the new action if you dont want it, AFAICT!?

perhaps there is a method other than 'handleDragOperationChanged' which
is called DragOperationChanged, and in that I can tell what th
eoperation is?


CL
Re: Need meta key info [message #172732 is a reply to message #172716] Mon, 21 March 2005 16:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> Well a Link would imply dropped instances to be linked. Thats what I am
> looking to imply, though linking means not necessarily what you specified
> in the context of my application.
>
> Because their is the idea of 'linking' and my app uses 'linking' I want to
> stay consistent with the method the user would normally use when dropping
> something and trying to create a link.
>
> I say the COPY set there. But the listener seems to be completely aware
> that the only action would be copy. So I fear the change will be more
> complicated.

I'm sure linking makes sense in your application. But why linking
templates? Can't you use some other transfer and your own drop listener?
What are you actually linking?

> I see. I guess I had used the awt system before and was used to it. Now I
> gotta get a feel for this swt one which is slightly different. Like when
> dropActionChanged() is called, how do I get an indication of what it was
> changed to? in the awt system, there is an event object passed into this
> method and you can tell from that. But here there is no way to know, nor
> reject the new action if you dont want it, AFAICT!?

Our "handle" methods are similar to the way we designed our tool
implementation. You can access the last event by calling getXxxEvent(), and
then look at the detail to see what the new type is.

The handle methods are slightly higher-level, and involve sending requests
to target editparts. The "raw" receiving method is more low-level and does
things such as resetting the timer for interpreting a mouse hover.
Re: Need meta key info [message #172800 is a reply to message #172732] Mon, 21 March 2005 18:19 Go to previous message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

Randy Hudson wrote:
>>Well a Link would imply dropped instances to be linked. Thats what I am
>>looking to imply, though linking means not necessarily what you specified
>>in the context of my application.
>>
>>Because their is the idea of 'linking' and my app uses 'linking' I want to
>>stay consistent with the method the user would normally use when dropping
>>something and trying to create a link.
>>
>>I say the COPY set there. But the listener seems to be completely aware
>>that the only action would be copy. So I fear the change will be more
>>complicated.
>
>
> I'm sure linking makes sense in your application. But why linking
> templates? Can't you use some other transfer and your own drop listener?
> What are you actually linking?
>

Yes, I can make one from scratch. I guess I didn't see the line between
GEF library and the logic examples maybe.

When you drop a template, it will repsenent a component. Either a new
component, or an existing component. If its an existing component, then
its 'linked' to the other instance of that existing component.

What I am trying to do is allow different drop behaviors. Best way is
to use existing methodologies like LINK, COPY, MOVE. These are already
interpreted and understood on each platform. So I like to use these
deciphered behaviors, as opposed to simply saying, "is CTRL down?" since
this could mean different things to users of different OSes.

The main issue is how can I handle the meta keys on drop. With the
current transfer, I can not because all meta keys info is blocked, since
the drop action is always copy.

I would prefer that if someone tried to do a link, or move, but all the
targeted accepted was COPY, the attempted link or move would fail. But
as it stands, when you try to link or move, you get feedback indicating
your attempted operation is acceptable. But upon ecexution you dont get
what you thought you were getting, instead you get COPY. Don't seem
right. But thats a 2nd issue really.

This is because my old implementation used the awt dnd system, and I was
able to specify what I accepted and what I did not. Probably I still
can if I write my own DropTargetListener.


>
>>I see. I guess I had used the awt system before and was used to it. Now I
>>gotta get a feel for this swt one which is slightly different. Like when
>>dropActionChanged() is called, how do I get an indication of what it was
>>changed to? in the awt system, there is an event object passed into this
>>method and you can tell from that. But here there is no way to know, nor
>>reject the new action if you dont want it, AFAICT!?
>
>
> Our "handle" methods are similar to the way we designed our tool
> implementation. You can access the last event by calling getXxxEvent(), and
> then look at the detail to see what the new type is.
>
> The handle methods are slightly higher-level, and involve sending requests
> to target editparts. The "raw" receiving method is more low-level and does
> things such as resetting the timer for interpreting a mouse hover.
>

problem with this seems to be how to indicate that the current operation
is not acceptable?



CL
Previous Topic:How to make the line bold?
Next Topic:find jar file
Goto Forum:
  


Current Time: Fri Aug 23 11:17:56 GMT 2024

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

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

Back to the top