getDragAndDropFeatures does not show a pop up

12 views
Skip to first unread message

Simone Di Cola

unread,
Jun 4, 2014, 2:20:50 PM6/4/14
to spray...@googlegroups.com
As in the subject,
 overriding  getDragAndDropFeatures and provinding 2 or more elements does not show a pop up.  http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.graphiti.doc%2Fresources%2Fdocu%2Fgfw%2Fanchors.htm

Is this a bug? 

Simone




Jörg Reichert

unread,
Jun 4, 2014, 2:24:06 PM6/4/14
to spray...@googlegroups.com
"presented a popup menu on drop showing all applicable features (applicable means canExecute returns true)."

Did you check if the elements you provided both returns true in canExecute?

Joerg
--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "spray-user" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an spray-users...@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

Simone Di Cola

unread,
Jun 4, 2014, 2:31:39 PM6/4/14
to spray...@googlegroups.com

Nope

Sie erhalten diese Nachricht, weil Sie in Google Groups ein Thema der Gruppe "spray-user" abonniert haben.
Wenn Sie sich von diesem Thema abmelden möchten, rufen Sie https://groups.google.com/d/topic/spray-users/cG9tpWv2jLE/unsubscribe auf.
Wenn Sie sich von dieser Gruppe und allen Themen dieser Gruppe abmelden möchten, senden Sie eine E-Mail an spray-users...@googlegroups.com.

Simone Di Cola

unread,
Jun 5, 2014, 7:02:17 AM6/5/14
to spray...@googlegroups.com
The problem is that this function in class AbstractCreateConnectionFeature.

public boolean canExecute(IContext context) {
boolean ret = false;
if (context instanceof ICreateConnectionContext) {
ret = canCreate((ICreateConnectionContext) context);
}
return ret;
}

returns always false. The problem is that context is always of type PictogramElement even when I click on an anchor. 

Any help?
Simone

On Wednesday, June 4, 2014 7:31:39 PM UTC+1, Simone Di Cola wrote:

Nope

On 4 Jun 2014 19:24, "Jörg Reichert" <de.abg.reichert.joerg@gmail.com> wrote:
"presented a popup menu on drop showing all applicable features (applicable means canExecute returns true)."

Did you check if the elements you provided both returns true in canExecute?

Joerg

Am 04.06.2014 20:20, schrieb Simone Di Cola:
As in the subject,
 overriding  getDragAndDropFeatures and provinding 2 or more elements does not show a pop up.  http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.graphiti.doc%2Fresources%2Fdocu%2Fgfw%2Fanchors.htm

Is this a bug? 

Simone




--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "spray-user" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an spray-users+unsubscribe@googlegroups.com.

Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

--
Sie erhalten diese Nachricht, weil Sie in Google Groups ein Thema der Gruppe "spray-user" abonniert haben.
Wenn Sie sich von diesem Thema abmelden möchten, rufen Sie https://groups.google.com/d/topic/spray-users/cG9tpWv2jLE/unsubscribe auf.
Wenn Sie sich von dieser Gruppe und allen Themen dieser Gruppe abmelden möchten, senden Sie eine E-Mail an spray-users+unsubscribe@googlegroups.com.

Simone Di Cola

unread,
Jun 5, 2014, 7:05:23 AM6/5/14
to spray...@googlegroups.com
This is what I get in detail from the canCreate

CONTEX:  class org.eclipse.graphiti.internal.features.context.impl.base.PictogramElementContext
CREATE: class man.ac.uk.xman.compositedesign.features.CompositeDesignCreateCoordinationConnectionFeature CAN EXECUTE:false
CREATE:  class man.ac.uk.xman.compositedesign.features.CompositeDesignCreateDataChannelFeature CAN EXECUTE:false

Simone Di Cola

unread,
Jun 5, 2014, 7:44:11 AM6/5/14
to spray...@googlegroups.com
If I use the connection from the palette, I correctly get this:

Context  class org.eclipse.graphiti.features.context.impl.CreateConnectionContext

More confused now.

Simone Di Cola

unread,
Jun 5, 2014, 7:51:28 AM6/5/14
to spray...@googlegroups.com
Even if canExecute returns two true, not pop up appears. 

Simone Di Cola

unread,
Jun 5, 2014, 9:35:45 AM6/5/14
to spray...@googlegroups.com
Jerg,
 I think the problem is in this class AdvancedAnchorEditPart, it does not call canExecute. 

Simone Di Cola

unread,
Jun 5, 2014, 11:16:15 AM6/5/14
to spray...@googlegroups.com
I am continuing my investigation :) 
So what is invoked is canStart first. The problem is that the sourceObject  here

package org.eclipse.graphiti.ui.internal.command;
[...]
private CreateConnectionContext createContext() {
Anchor sourceAnchor = getAnchor(sourceObject);  
[...]

Any clue?


is set as BoxAnchor..... when I start with drag&drop, while if I use the palette is the correct EClass. 

Simone Di Cola

unread,
Jun 5, 2014, 11:19:17 AM6/5/14
to spray...@googlegroups.com
CHECK CAN START! FROM:org.eclipse.graphiti.mm.pictograms.impl.BoxRelativeAnchorImpl@18f69e2 (visible: true, active: true) (useAnchorLocationAsConnectionEndpoint: false) (relativeWidth: 0.5, relativeHeight: 1.0)


On Wednesday, June 4, 2014 7:20:50 PM UTC+1, Simone Di Cola wrote:

Simone Di Cola

unread,
Jun 5, 2014, 11:49:02 AM6/5/14
to spray...@googlegroups.com
How can I modify that jar? I got the solution, but  I cannot modify it. Anyway, it seems very odd to me that anybody else have experienced the same bug. Is it maybe something with my environment?

Simone  

Simone Di Cola

unread,
Jun 6, 2014, 10:35:53 AM6/6/14
to spray...@googlegroups.com
Found a solution, but Spray has serious problems with anchors. 
Reply all
Reply to author
Forward
0 new messages