Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » control which items can be parents for new items 'clicked' rather than dragged from the palette
control which items can be parents for new items 'clicked' rather than dragged from the palette [message #134086] Tue, 25 May 2004 14:15 Go to next message
Eclipse UserFriend
Originally posted by: evanlinwood.hotmail.com

Hi,
When I click on an item in the palette, and then hover over items in my
model, I want to be able to selectively determine which types of items
(already present in the model) will accept the new item as a child, and
which will not (in which case the cursor should turn into a stop-sign).

I've managed to implement isEnabled() OK on a subclassed
TemplateTransferDropTargetListener such that when I drag an item off the
palette, I can selectively determine which types of editparts I can drop it
onto. (The cursor turns into a stop-sign for those I don't want it to be
possible to drop into).

I've also managed to control 'dragging' of existing items already in the
model with respect to which types of new parents they can be dropped onto
using isTargetLocked() in a DragEditPartsTracker(). I haven't been able to
figure out how to get the stop-sign cursor to appear in this case.

If anybody can suggest how to solve in particular the first case, your help
would be greatly appreciated!

Evan
Re: control which items can be parents for new items 'clicked' rather than dragged from the palette [message #134260 is a reply to message #134086] Tue, 25 May 2004 21:05 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You shouldn't be using isTargetLocked probably. Indication of not allowed
is done by Command.isExecutable(). The exception is drop targets, which do
not attempt to obtain a command because the item being dropped is not always
available during hte dragover callbacks.

"Evan Linwood" <evanlinwood@hotmail.com> wrote in message
news:c8vk6t$eju$1@eclipse.org...
> Hi,
> When I click on an item in the palette, and then hover over items in my
> model, I want to be able to selectively determine which types of items
> (already present in the model) will accept the new item as a child, and
> which will not (in which case the cursor should turn into a stop-sign).
>
> I've managed to implement isEnabled() OK on a subclassed
> TemplateTransferDropTargetListener such that when I drag an item off the
> palette, I can selectively determine which types of editparts I can drop
it
> onto. (The cursor turns into a stop-sign for those I don't want it to be
> possible to drop into).
>
> I've also managed to control 'dragging' of existing items already in the
> model with respect to which types of new parents they can be dropped onto
> using isTargetLocked() in a DragEditPartsTracker(). I haven't been able
to
> figure out how to get the stop-sign cursor to appear in this case.
>
> If anybody can suggest how to solve in particular the first case, your
help
> would be greatly appreciated!
>
> Evan
>
>
>
Previous Topic:Connection end labels + feedback
Next Topic:Problem with ComboBox Property Descriptor
Goto Forum:
  


Current Time: Sat Apr 27 04:10:47 GMT 2024

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

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

Back to the top