| [news.eclipse.modeling.gmf] Re: Inserting a line break when editing a WrappingLabel |
Hi Thomas,
Perfect. This works wonderfully now. Many thanks for your assistance.
Cheers, Louis.
Louis,
you have to modify the corresponding EditManager.
Setting the textwrap to true only makes the wrappinglabel capable of displaying multiline text.
Inserting manual line-breaks while editing you will have to do the following:
In your LabelEditPart, that should allow wrapping, modify
protected DirectEditManager getManager() {
if (manager == null) {
setManager(new TextDirectEditManager(this, WrapTextCellEditor.class, XXXEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
In combination with setting textwrap to true in the createcontent-method of the parent EditPart, this shouls do the trick.
HTH & regards
Thomas
"Louis Rose" <louis@xxxxxxxxxxxxx <mailto:louis@xxxxxxxxxxxxx>> schrieb im Newsbeitrag news:0f7841f34955e8b343ffa53304fb9041$1@xxxxxxxxxxxxxxxxxx
> Hi all,
>
> I was wondering if it is possible to insert a line break when editing a
> WrappingLabel in GMF? I've tried various keystrokes (Enter, CTRL+Enter,
> SHIFT+Enter and ALT+Enter), but none seem to work.
>
> I've set the text wrap property of a WrappingLabel to true - and text is
> being wrapped correctly - but I would like to insert line breaks to
> control when text is to be wrapped.
>
> Best regards,
> Louis.
>