Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsGMF: annoying popup window when creating connections
https://www.eclipse.org/forums/index.php/mv/msg/204614/654353/#msg_654353
in a GMF graphical editor, when I drag a connector, the framework displays a popup window showing text "Create [myConnection] to Existing Element/Create [myConnection] to New Element"; this is very annoying, and I have to eliminate it or, at least, customize its behaviour to show custom types. I googled a lot, but I'm unable to find the related implementation classes to subclass or modify them.
Is there somebody who knows about?
Thanks,
Giovanni]]>Giovanni De Sossi2011-02-15T11:17:43-00:00Re: GMF: annoying popup window when creating connections
https://www.eclipse.org/forums/index.php/mv/msg/204614/655103/#msg_655103
I think this behavior is triggered by the POPUP_ROLE edit policy.
You can remove this edit policy on your edit part in the createDefaultEditPolicy methods with something like :
You can either sublass your EditParts or use a Custom EditPolicyProvider
(see extension point org.eclipse.gmf.runtime.diagram.ui.editpolicyProviders )
HTH
]]>Romain Bioteau2011-02-18T10:46:48-00:00Re: GMF: annoying popup window when creating connections
https://www.eclipse.org/forums/index.php/mv/msg/204614/655118/#msg_655118
thank you for your help, but the POPUPBAR_ROLE is not what I need; as you can see by javadoc: /**
* The key used to install a <i>popup bar</i> EditPolicy. The popup bar
* will be activated during mouse hover for the editpart.
*/
public static final String POPUPBAR_ROLE = "PopupBarEditPolicy";
this role is responsible for showing a list of possible object to create when you move the mouse hover the editPart; moreover, I uninstalled this role yet.
My problem come in when I use the Palette button to create a connection: I select the source (a Node) and then I drag the mouse on a blank side of diagram; at that time the popup appears.
This behaviour is built-in in classes org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeCrea tionTool and UnspecifiedTypeConnectionTool, as the javadoc says:
/**
* This specialized creation tool adds support for a multi-type creation tool.
* That is, the tool is given a list of element types and when the user completes
* the gesture, a popup appears asking the user to pick one of the element types
* to be created.
*
* @author cmahoney
*/
I came up here........]]>Giovanni De Sossi2011-02-18T12:02:20-00:00Re: GMF: annoying popup window when creating connections
https://www.eclipse.org/forums/index.php/mv/msg/204614/655129/#msg_655129
What about removing the EditPolicyRoles.CONNECTION_HANDLES_ROLE editPolicy ?
You can also try this :
Add a Link constraints in the .gmfmap (in Java by example)
with someting like :
if(target == null){
return false ;
}
It will generate a LinkConstraint static class containing a canExistsYourLink containing the constraint.
HTH
Romain]]>Romain Bioteau2011-02-18T12:57:50-00:00Re: GMF: annoying popup window when creating connections
https://www.eclipse.org/forums/index.php/mv/msg/204614/655483/#msg_655483
unfortunately I removed the EditPolicyRoles.CONNECTION_HANDLES_ROLE editPolicy yet, it doesn't do the work. Your suggestion about Link Constraints it's interesting, but I cannot relaunch the GMF tooling now, the code was freezed a few months ago, I can just extend it.
Maybe you know a way to obtain same result without regenerate the code?
Thanks,
Giovanni]]>Giovanni De Sossi2011-02-21T10:50:25-00:00Re: GMF: annoying popup window when creating connections
https://www.eclipse.org/forums/index.php/mv/msg/204614/655495/#msg_655495
You can directly edit the diagram code in YourDomainBaseItemSemanticEditPolicy you have a static class LinkConstraints. Search for a method canCreateTheNameofYourLink and add the "target == null then return false" here.
HTH
Romain]]>Romain Bioteau2011-02-21T13:11:51-00:00Re: GMF: annoying popup window when creating connections
https://www.eclipse.org/forums/index.php/mv/msg/204614/655501/#msg_655501
Bye,
Giovanni]]>Giovanni De Sossi2011-02-21T13:27:42-00:00