Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMFForms] Improvements on the Layout of the generated Form
[EMFForms] Improvements on the Layout of the generated Form [message #1743411] Thu, 15 September 2016 07:59 Go to next message
Peter Hermsdorf is currently offline Peter HermsdorfFriend
Messages: 25
Registered: August 2011
Junior Member
Hi,

please see attached screenshot nad view model: It's based on an simple ecore model consisting of one multiline test field, a datefield (with custom renderer) and a multireference attribte (with custom renderer - see my previous post here...)
The Form is embedded into a Dialog.

index.php/fa/27076/0/

I'm looking for improvements in the overall appearience of the form.

1) I have configured the label alignment of the multiline field to "Top" but is is rendered centered vertically. Why?

2) the multiline field ("Beschreibung") get's pretty large - the expected input normally should not exceed 2-3 lines. Is there a way (besides custom renderer) to control the height of this field?

3) The alignment of the table for the multi reference selection does not look good. at least i would expect to be aligned with the other input fields above - maybe with a label in front.

4) in the view editor it's possible to add a "Compound Control". I wasn't able to find any documentation about this control and from looking at the implementation it's not absoloutly clear to me what's the use case for this control. Some insight would be more than welcome here.

5) As pointed out before - the form is shown in a Dialog. Currently i have to hardcode the Dialog size (dependent on the expected form that gets rendered in the dialog ).
Is there a way to get the "computed" / expected form size to let the Dialog resize when created?

6) Do you have any ideas how to restructure / re-layout the view to improve it?

Thanks for any hints!

best regards, peter
Re: [EMFForms] Improvements on the Layout of the generated Form [message #1743517 is a reply to message #1743411] Fri, 16 September 2016 07:39 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 130
Registered: May 2015
Senior Member
Hi Peter,
1) Top label alignment is not supported, we never extended the default renderer to use this
2) the height hint is 200px, you can only change it by subclassing.
3) you would need to override the getGridDescription(SWTGridDescription) method and return 2 or 3 columns instead of the 1. We decided to not align it as tables and multi controls look and behave completly different compared to single controls like text.
4) compound control is specific element to align controls in a very specific grid, with exactly one custom label per row
5) If you do something like this:
final Composite content = new Composite(parent, SWT.NONE);
content.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
content.setLayout(GridLayoutFactory.fillDefaults().margins(10, 10).create());
content.setLayoutData(GridDataFactory.fillDefaults().create());

render = ECPSWTViewRenderer.INSTANCE.render(content, dummyObject);

content.layout();
you can get the size of the content and assign it to the dialog : dialog.setSize(content.getSize())
6) what do you want to improve?

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMFForms] Improvements on the Layout of the generated Form [message #1743851 is a reply to message #1743517] Tue, 20 September 2016 09:09 Go to previous messageGo to next message
Peter Hermsdorf is currently offline Peter HermsdorfFriend
Messages: 25
Registered: August 2011
Junior Member
Hi Eugen,

thanks for you comments, by overriding the default renderers i was able to accomplish most of the layout issues.

Regarding point 2): it would be nice to have a configuration option (in the view itself or via a template/style definition) to override the default heigth hint of 200 depending on the conrete field (depending on the expected content).
A general option to add size hints for the different controls in a view would also help to control the rendered layout, regarding the auto-sizing of the dialog mentioned in point 5) (otherwise the sizes of the controls are too small / do not look good...)

Bye, Peter
Re: [EMFForms] Improvements on the Layout of the generated Form [message #1743857 is a reply to message #1743851] Tue, 20 September 2016 09:41 Go to previous message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 130
Registered: May 2015
Senior Member
Hi Peter,
we are always happy to accept a contribution or sponsored development Smile.
Currently the only way to provide size hints is overriding the control and provide custom gridcell descriptions with the size hint set.

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:[EMF Forms] Change the label of a feature without modifying it in the model
Next Topic:[EMF Forms] Implement check on data input
Goto Forum:
  


Current Time: Sun Apr 22 01:30:45 GMT 2018

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

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