Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Node Label Pattern Configuration
Node Label Pattern Configuration [message #1058499] Tue, 14 May 2013 11:15 Go to next message
serhat gezgin is currently offline serhat gezginFriend
Messages: 243
Registered: January 2013
Location: Izmir
Senior Member
Hi all,

@gmf.node(label="name,field.name", figure="rectangle", label.icon="false", label.pattern="{0} : {1}", label.edit.pattern="{0}")
class ViewField extends ContentUnit {
  attr String[1] name;
  ref Field[1] field;
}

abstract class Field extends ContentUnit {
  attr String[1] name;
}



i need to set ViewField label name on diagram = self.name + self.field.name but when i try above code its not work so how can i done this anyone can help me ?

Regards
Re: Node Label Pattern Configuration [message #1058641 is a reply to message #1058499] Tue, 14 May 2013 15:19 Go to previous message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Hi serhat,

I'm afraid using something like 'field.name' is not supported by Eugenia at the moment. Eugenia maps 'label="a,b"' to GMF feature label mappings, and these are restricted to the attributes of the EClass itself. We'd need to implement a different kind of mapping, and I'm not 100% sure GMF will allow for it in its models or if it will need custom code.

Incidentally, you might want to use label.view.pattern and label.edit.pattern instead of label.pattern and label.edit.patttern. label.pattern is both for editing and viewing, and I'm not sure if label.edit.pattern might conflict with it.

Update: I've looked a bit into this and you may need to use a GMF Expression Label Mapping. Eugenia does not support them, and I'm not sure if we should: according to the official documentation, users need to customize the generated code anyway to have changes in the label update the model. Here is some documentation I have found regarding these mappings:

http://wiki.eclipse.org/GMF_2.3_New_and_Noteworthy#2.3_M6

A polishing transformation and a bit of custom code in the generated label class should do the job, I think.

Best regards,
Antonio

[Updated on: Tue, 14 May 2013 15:33]

Report message to a moderator

Previous Topic:Question about adjusting links
Next Topic:EuGENia Annotations
Goto Forum:
  


Current Time: Fri Apr 19 03:41:21 GMT 2024

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

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

Back to the top