Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Issue with drop in Compartment Pattern(Not able to get drop handle in inner compartment)
Issue with drop in Compartment Pattern [message #1067302] Mon, 08 July 2013 09:10 Go to next message
Rahul Dev Mishra is currently offline Rahul Dev MishraFriend
Messages: 11
Registered: July 2013
Location: Bangalore, India
Junior Member
Hi All,

I have created a node namely "Union_1" which is our main compartment using Compartment Pattern. To this node, I add an entry, lets say a database table. The entries in the node are actually Compartment entries / shape.

Now when I select another node and hover my mouse over the database table, I get a
"Do-Not-Drop" icon. I am not able to get a drop handle over the added entry.

I have attached a video for your better reference.

Thanks & Regards,
Rahul Dev Mishra

Re: Issue with drop in Compartment Pattern [message #1067373 is a reply to message #1067302] Mon, 08 July 2013 13:04 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Rahul,

not fully sure about the compartment pattern, but in standard Graphiti the
do-not-drop icon is caused by the canAdd method returning false. Have you
checked that method in your pattern?

Michael

"Rahul Dev Mishra" schrieb im Newsbeitrag
news:krec0n$djs$1@xxxxxxxxe.org...

Hi All,

I have created a node namely "Union_1" which is our main compartment using
Compartment Pattern. To this node, I add an entry, lets say a database
table. The entries in the node are actually Compartment entries / shape.

Now when I select another node and hover my mouse over the database table, I
get a
"Do-Not-Drop" icon. I am not able to get a drop handle over the added entry.

I have attached a video for your better reference.

Thanks & Regards,
Rahul Dev Mishra
Re: Issue with drop in Compartment Pattern [message #1067393 is a reply to message #1067373] Mon, 08 July 2013 13:51 Go to previous messageGo to next message
Rahul Dev Mishra is currently offline Rahul Dev MishraFriend
Messages: 11
Registered: July 2013
Location: Bangalore, India
Junior Member
Hi Michael,

CompartmentPattern is another pattern which extends AbstractPattern.

Anyways the method canAdd() is overridden from the class AbstractBasePattern and is always set to true.

Still then I don't get a drop handle as shown in the video.

Thanks & Regards,
Rahul Dev Mishra
Re: Issue with drop in Compartment Pattern [message #1067409 is a reply to message #1067393] Mon, 08 July 2013 14:31 Go to previous messageGo to next message
Albert Hofkamp is currently offline Albert HofkampFriend
Messages: 41
Registered: August 2009
Member
A video is great for demonstrating how it behaves for the user.
However, nobody here doubts what you experience with your editor. There is no need to proof you are telling the truth here, we believe you.

The problem with a video is that it does not show internals. That is, you show it is broken, but we cannot inspect the internals to see how or why it is broken.

To get forward in solving the problem, I believe the internals of "why" is what you should focus on. Your answer, and the answer of Michael Wenz sound contradictionary, so it would be useful to verify what the real code does at this point. Use a debugger or print information while running the code to check that your code gets called, and that it returns the expected value.

If that does not help, the problem must be more hidden. A useful strategy here is to reduce the amount of code, until you have a working editor. The last reduction step you made then should contain the real cause of the failure.

Re: Issue with drop in Compartment Pattern [message #1067490 is a reply to message #1067409] Tue, 09 July 2013 05:10 Go to previous messageGo to next message
Rahul Dev Mishra is currently offline Rahul Dev MishraFriend
Messages: 11
Registered: July 2013
Location: Bangalore, India
Junior Member
Hi,

After further investigating the issue, this is what is happening:
when I select a node from the palette and hover my mouse over the element which is already present in a another node:


    Even before
    canAdd()
    is called, ShapeHighlightEditPolicy's method
    showTargetFeedback(Request request)
    is called. Here the request would be of type "create child".
    Now this method retrieves the command by calling getCommand() present in AbstractEditPart.
    In this method it retrieves all the edit policies, iterates over them one by one and calls
    getCommand(request)
    present in the LayoutEditPolicy class.
    Now in here the request type is checked and if the required request matches, then
    getCreateCommand((CreateRequest) request)
    is called. The problem is this method call goes to ShapeForbidLayoutEditPolicy class which returns null.



Re: Issue with drop in Compartment Pattern [message #1067543 is a reply to message #1067490] Tue, 09 July 2013 09:32 Go to previous message
Rahul Dev Mishra is currently offline Rahul Dev MishraFriend
Messages: 11
Registered: July 2013
Location: Bangalore, India
Junior Member
Hi Michael / Albert,

The issue is resolved now.

The new entry which was getting created inside the node was of type Shape. Hence the drop was not happening over it. Now I have changed it to Container shape and I am able to see the drop icon when I hover my mouse over the element.

Thanks a lot for the quick replies.

Thanks & Regards,
Rahul Dev Mishra
Previous Topic:Insert a PictogramElement into another
Next Topic:Save exception - UnknownServiceException
Goto Forum:
  


Current Time: Fri Apr 26 23:47:31 GMT 2024

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

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

Back to the top