Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » ECP/ EMF Forms , wordwrap in text widgets
ECP/ EMF Forms , wordwrap in text widgets [message #1248666] Mon, 17 February 2014 14:23 Go to next message
Neil Mackenzie is currently offline Neil MackenzieFriend
Messages: 131
Registered: December 2013
Senior Member
Hello,
does anyone know if it is possible to have wordwrap in the widgets displaying lots of text in EMF Forms. It seems to be that the standard widgets supplied for showing text attributes in the RCP and RAP version of ECP are always as wide as the longest line of my multi-line text. So if I have a sentence that is 400 characters long, then my text widget is 400 characters wide which makes it difficult to read.
I tried using some vertical and horizontal layouts, but this didn't solve my problem.
Maybe there is anther way to do it with layouts/spans, or maybe I can create a custom widget for this. I am particularly interested in this working with the RAP version of ECP.
Thanks,
Neil
Re: ECP/ EMF Forms , wordwrap in text widgets [message #1249487 is a reply to message #1248666] Tue, 18 February 2014 09:48 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

thank you for the report, we can reproduce this:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=428397
A work-Around would be to regsiter your own control:
http://eclipsesource.com/blogs/tutorials/how-to-customize-emf-forms/#customizecontrols
However, it would be great to receive a contribution for this BR, too.

Best Regards

Jonas

Am 17.02.2014 15:23, schrieb Neil Mackenzie:
> Hello,
> does anyone know if it is possible to have wordwrap in the widgets
> displaying lots of text in EMF Forms. It seems to be that the standard
> widgets supplied for showing text attributes in the RCP and RAP version
> of ECP are always as wide as the longest line of my multi-line text. So
> if I have a sentence that is 400 characters long, then my text widget is
> 400 characters wide which makes it difficult to read.
> I tried using some vertical and horizontal layouts, but this didn't
> solve my problem.
> Maybe there is anther way to do it with layouts/spans, or maybe I can
> create a custom widget for this. I am particularly interested in this
> working with the RAP version of ECP. Thanks,
> Neil
Re: ECP/ EMF Forms , wordwrap in text widgets [message #1249851 is a reply to message #1249487] Tue, 18 February 2014 17:55 Go to previous messageGo to next message
Neil Mackenzie is currently offline Neil MackenzieFriend
Messages: 131
Registered: December 2013
Senior Member
Thanks,
I will have a look into finding the problem,I suspect its to do with settings such as SWT.SINGLE and/or similar on the Text widgets
I have the source code from git for branch release_1.20
It is fairly clear how to compile it and run the code for the RCP version, I have few questions about working with the source code for RAP,

1.)For RAP should I compile against the ECP_RAP target? This is currently pointing to EMFStore 1.0 and not 1.1, and doesn't allow everything to compile, but maybe it allows enough o compile to run ECP on RAP?)
2.)Should I launch with the rap2 run configuration from git, is this kept up to date?
3.) Should the 1.2 branch always compile and run fro RAP, or is it sometimes less stable
4.) is there a way get the state of the code as it was released for RC1, RC2 etc.

Thanks,
Neil

Re: ECP/ EMF Forms , wordwrap in text widgets [message #1250447 is a reply to message #1249851] Wed, 19 February 2014 08:51 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

Before I can answer your questions: which branch have you checked out?
on master you always find the latest release (1.1.1) on develop you will
find the latest state. The sources of the RC for 1.2.0 can be found in
this branch: release_1.2.0

Best regards

Jonas



Am 18.02.2014 18:55, schrieb Neil Mackenzie:
> Thanks,
> I will have a look into finding the problem,I suspect its to do with
> settings such as SWT.SINGLE and/or similar on the Text widgets
> I have the source code from git for branch release_1.20
> It is fairly clear how to compile it and run the code for the RCP
> version, I have few questions about working with the source code for RAP,
>
> 1.)For RAP should I compile against the ECP_RAP target? This is
> currently pointing to EMFStore 1.0 and not 1.1, and doesn't allow
> everything to compile, but maybe it allows enough o compile to run ECP
> on RAP?)


> 2.)Should I launch with the rap2 run configuration from git, is this
> kept up to date?
> 3.) Should the 1.2 branch always compile and run fro RAP, or is it
> sometimes less stable
> 4.) is there a way get the state of the code as it was released for
> RC1, RC2 etc.
>
> Thanks,
> Neil
>
>
Re: ECP/ EMF Forms , wordwrap in text widgets [message #1250494 is a reply to message #1250447] Wed, 19 February 2014 09:47 Go to previous messageGo to next message
Neil Mackenzie is currently offline Neil MackenzieFriend
Messages: 131
Registered: December 2013
Senior Member
Hi Jonas,
I have been using the release_1.2.0 branch.
Regards,
Neil
Re: ECP/ EMF Forms , wordwrap in text widgets [message #1250613 is a reply to message #1250494] Wed, 19 February 2014 12:07 Go to previous messageGo to next message
Neil Mackenzie is currently offline Neil MackenzieFriend
Messages: 131
Registered: December 2013
Senior Member
btw I think I have found a simple fix to the problem, I will test it a bit further.

In the Class org.eclipse.emf.ecp.edit.internal.swt.controls.StringControl

I replaced
gridData.heightHint = 200;
with
"gridData.heightHint = 200;
gridData.widthHint = 200;"

I replace this in the methods where gridData.heightHint = 200 exists (so both getTextWidgetStyle() and getTextWidgetLayoutData(), its probably not needed in the first one)

I don't know how to specify that my control should be multiline for my model elements attributes so I have forced it in the code for now.

I thought this fix would limit the width to be 200 always, but instead it does exactly what I want, it wordwraps the text to however wide the text area gets.
Will test further.

Regards,
NEeil



Re: ECP/ EMF Forms , wordwrap in text widgets [message #1250634 is a reply to message #1250613] Wed, 19 February 2014 12:36 Go to previous messageGo to next message
Neil Mackenzie is currently offline Neil MackenzieFriend
Messages: 131
Registered: December 2013
Senior Member
I havent tested this on RAP yet btw.
Multiline I found I can set in my .genmodel file.
It appears that the change is indeed only needed in getTextWidgetLayoutData()
It looks like this change would mean that the text area never gets less width than 200, which is ok for me, dont know about other users, something like 50 might be better.
Regards,
Neil

[Updated on: Wed, 19 February 2014 12:36]

Report message to a moderator

Re: ECP/ EMF Forms , wordwrap in text widgets [message #1251535 is a reply to message #1250613] Thu, 20 February 2014 10:19 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Am 19.02.2014 13:07, schrieb Neil Mackenzie:
> btw I think I have found a simple fix to the problem, I will test it a
> bit further.
>
> In the Class org.eclipse.emf.ecp.edit.internal.swt.controls.StringControl
>
> I replaced gridData.heightHint = 200;
> with
> "gridData.heightHint = 200;
> gridData.widthHint = 200;"
>
> I replace this in the methods where gridData.heightHint = 200 exists (so
> both getTextWidgetStyle() and getTextWidgetLayoutData(), its probably
> not needed in the first one)
>
> I don't know how to specify that my control should be multiline for my
> model elements attributes so I have forced it in the code for now.
By setting the property type to multi line (in the genmodel)
>
> I thought this fix would limit the width to be 200 always, but instead
> it does exactly what I want, it wordwraps the text to however wide the
> text area gets.
> Will test further.
>
> Regards,
> NEeil
>
>
>
>
Re: ECP/ EMF Forms , wordwrap in text widgets [message #1251539 is a reply to message #1250634] Thu, 20 February 2014 10:20 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Neil, once you have found out exactly what you need, please consider to
file a bug report. Please let me know, if there are any open questions...

Am 19.02.2014 13:36, schrieb Neil Mackenzie:
> I havent teted this on RAP yet btw.
> Multiline I found I can set in my .genmodel file.
> It appears that the change is indeed only needed in
> getTextWidgetLayoutData()
> It looks like this change would mean that the text area never gets less
> width than 200, which is ok for me, dont know about other users,
> something like 50 might be better.
> Regards,
> Neil
Re: ECP/ EMF Forms , wordwrap in text widgets [message #1251695 is a reply to message #1251539] Thu, 20 February 2014 13:51 Go to previous message
Neil Mackenzie is currently offline Neil MackenzieFriend
Messages: 131
Registered: December 2013
Senior Member
thanks, I have updated the bug report for the multiline wordrap issue.
I cannot test my change yet on RAP as I cant launch a working RAP app from the release 1.2 branch (for which I have raised Bug 428647 - Cannot launch RAP with supplied ecpRapDemo launch script)
Previous Topic:[EMFStore]ResourcePersister throws NotSerializableException before commit
Next Topic:[EMF Forms] Using ViewModelService together with E4 DI
Goto Forum:
  


Current Time: Fri Mar 29 14:23:34 GMT 2024

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

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

Back to the top