Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Connector Labels (Polyline Connection)(PolylineConnection , Connector Label)
Connector Labels (Polyline Connection) [message #1059231] Fri, 17 May 2013 12:18 Go to next message
Dan Tololoi is currently offline Dan Tololoi
Messages: 33
Registered: September 2012
Location: Iasi, Romania
Member

Hi,

In one diagram I have a figure element that is the representation of a Polyline and for it I attached a label with a text. The Label is the one that you can show/hide in the diagram view by Show/Hide Connector Labels. When the text that goes to the Label becomes long, I need to make it multiple line or have it multiple line from the beginning. I tried to change the type from a Label to a Custom Figure and set the CustomAttribute textWrap to true , but not possible to see this happening the moment the Label is displayed in the Diagram Editor.
Any idea is welcome.
Re: Connector Labels (Polyline Connection) [message #1060445 is a reply to message #1059231] Fri, 24 May 2013 16:56 Go to previous messageGo to next message
Thomas Beyer is currently offline Thomas Beyer
Messages: 55
Registered: February 2013
Member
Hi Dan,

your generated EditPart has most likely an underlying "WrappingLabel" as its figure, which has the
setTextWrap(...)

implemented by default.
Make sure, when you perform the actual editing on the label to use CTRL+Enter to insert a linebreak, as only enter will commit the currently edited text.

Regards
Thomas
Re: Connector Labels (Polyline Connection) [message #1061384 is a reply to message #1060445] Fri, 31 May 2013 12:13 Go to previous message
Dan Tololoi is currently offline Dan Tololoi
Messages: 33
Registered: September 2012
Location: Iasi, Romania
Member

Hi Thomas,
I know that setTextWrap could do the trick. Just to make the picture more detailed:
- I have this text for the label taken from two other properties, based on the user selection of a flag. So I am extracting the text to be displayed like this:

public String getUsedGuard()
{
if(this.isRuleFromGrammar == true){if(basicGetGuardRuleName() != null)
return basicGetGuardRuleName().getRuleName();
else
return "";
}
else{
return this.getGuard();
}
}


So finally I will have a string that will populate the label. So the label is not edited directly in the view, but managed through other properties. This is why I am searching another way of forcing the label to have itself more lines and to manage the text that comes within.
Previous Topic:GMF generate diagram code through ant scripts from gmfgen
Next Topic:Error in .gmfmap model (in mapping model)
Goto Forum:
  


Current Time: Thu Oct 02 16:32:23 GMT 2014

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

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