Skip to main content



      Home
Home » Archived » Sapphire » How to model diagram connections using xml attributes
How to model diagram connections using xml attributes [message #1690548] Sat, 28 March 2015 11:01 Go to next message
Eclipse UserFriend
Hello,

My XML model contains directed edges expressed as "references by ID" in an attribute.

Example:
<step id="a" next="b"/>
<step id="b"/>
which means a connection (directed edge) from a to b.

How can I do this with Sapphire? So far I found only how to model connections using xml elements, not attributes.

Thanks in advance.
Re: How to model diagram connections using xml attributes [message #1690685 is a reply to message #1690548] Mon, 30 March 2015 11:34 Go to previous messageGo to next message
Eclipse UserFriend
In your Sapphire model, you can declare a list property for all the steps using a custom bind list. The use that list in your diagram's connection binding.

Here is an example of a custom bind list:

// *** ControlFlowRules ***

@Type( base = IControlFlowRule.class )
@CustomXmlListBinding( impl = ControlFlowRuleListBinding.class )

ListProperty PROP_CONTROL_FLOW_RULES = new ListProperty( TYPE, "ControlFlowRules" );

ElementList<IControlFlowRule> getControlFlowRules();
Re: How to model diagram connections using xml attributes [message #1690703 is a reply to message #1690685] Mon, 30 March 2015 12:53 Go to previous messageGo to next message
Eclipse UserFriend
You have two options:

1. Mold the model to conform to existing declarative patterns for diagram connections by using a custom binding to create a list around the attribute.

2. Implement a custom ConnectionService and attach it to the diagram in sdef. This approach might be more straight-forward in your scenario.
Re: How to model diagram connections using xml attributes [message #1691183 is a reply to message #1690703] Thu, 02 April 2015 18:22 Go to previous messageGo to next message
Eclipse UserFriend
Regarding the option 2., I suppose I cannot use StandardConnectionService but have to implement my own ConnectionService. Which means I have to implement also my own DiagramConnectionPart and IDiagramConnectionDef, right? Or is there an more straightforward way I am missing?

Thank you.
Re: How to model diagram connections using xml attributes [message #1691188 is a reply to message #1691183] Thu, 02 April 2015 20:27 Go to previous message
Eclipse UserFriend
Yes, you'd have to implement at least DiagramConnectionPart. The logic that maps your model concept to diagram connections would reside in your ConnectionService and DiagramConnectionPart implementations.
Previous Topic:Recursive Diagrams
Next Topic:Connection is not shown in diagram with abstract types
Goto Forum:
  


Current Time: Mon May 05 04:41:48 EDT 2025

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

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

Back to the top