Skip to main content


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 TololoiFriend
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 BeyerFriend
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 messageGo to next message
Dan Tololoi is currently offline Dan TololoiFriend
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.
Re: Connector Labels (Polyline Connection) [message #1816105 is a reply to message #1061384] Mon, 21 October 2019 10:15 Go to previous message
Naveen R is currently offline Naveen RFriend
Messages: 7
Registered: May 2019
Junior Member
Hi Thomas,

Can you share the sample code for adding the label to the polyline figure?

Should we add the label as a child to a polyline figure?
Previous Topic:DocumentProvider::createElementInfo does not handle IFileEditorInput
Next Topic:Opening properties view on clicking on any figure in canvas
Goto Forum:
  


Current Time: Sat Nov 09 02:18:01 GMT 2024

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

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

Back to the top