Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » How to model diagram connections using xml attributes
How to model diagram connections using xml attributes [message #1690548] Sat, 28 March 2015 15:01 Go to next message
Tomáš Milata is currently offline Tomáš MilataFriend
Messages: 15
Registered: March 2015
Junior Member
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 15:34 Go to previous messageGo to next message
Shenxue Zhou is currently offline Shenxue ZhouFriend
Messages: 60
Registered: July 2009
Member
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 16:53 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
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 22:22 Go to previous messageGo to next message
Tomáš Milata is currently offline Tomáš MilataFriend
Messages: 15
Registered: March 2015
Junior Member
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] Fri, 03 April 2015 00:27 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
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: Fri Sep 21 14:28:20 GMT 2018

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

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

Back to the top