Bug 547240 - no counterpart of new GridData(int style) in GridDataFactory
Summary: no counterpart of new GridData(int style) in GridDataFactory
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.11   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.13 M1   Edit
Assignee: Marcus Höpfner CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2019-05-14 03:14 EDT by Marcus Höpfner CLA
Modified: 2019-06-26 08:40 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Höpfner CLA 2019-05-14 03:14:35 EDT
With the mentioned constructor new GridData(int style) a GridData can be constructed setting up a lot of properties.

E.g. new GridData(GridData.FILL_HORIZONTAL) the following is set up (according to the constructor code)
horizontalAlignement = GridData.Fill;
verticalAlignment = GridData.CENTER; (default)
grabExcessHorizontalSpace = true;
grabExcessVerticalSpace = false; (default).

Writing new GridData(GridData.FILL_HORIZONTAL) with GDF ends up in:
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false);
which is much longer.

I'd suggest to have a new static method in GDF like GridDataFactory.style(int style) to cover the above.

With that we can also replace a lot of GridData usages in platform with GDF.
Comment 1 Eclipse Genie CLA 2019-05-28 07:52:28 EDT
New Gerrit change created: https://git.eclipse.org/r/142921
Comment 2 Marcus Höpfner CLA 2019-05-28 07:54:37 EDT
can someone pls. do a review and merge the commit.
afterwards I can rebase the commits for https://bugs.eclipse.org/bugs/show_bug.cgi?id=546990 and change the griddata coding.
Comment 3 Lars Vogel CLA 2019-05-28 08:24:35 EDT
We are currently in the 4.12 freeze, once 4.13 (1 or 2 weeks) opens, we can merge. 

I would suggest to have separate commits for the usage of new factory and would not fix that with Bug 54699.
Comment 4 Marcus Höpfner CLA 2019-05-28 08:29:39 EDT
(In reply to Lars Vogel from comment #3)
> We are currently in the 4.12 freeze, once 4.13 (1 or 2 weeks) opens, we can
> merge. 
> 
> I would suggest to have separate commits for the usage of new factory and
> would not fix that with Bug 54699.

+1
Comment 5 Eclipse Genie CLA 2019-06-11 08:27:21 EDT
New Gerrit change created: https://git.eclipse.org/r/143715
Comment 6 Lars Vogel CLA 2019-06-25 09:57:56 EDT
Marcus, can you create a new bug for using this new factory and push at least one Gerrit to use it in platform code.
Comment 7 Lars Vogel CLA 2019-06-25 09:58:29 EDT
Once done, we should also add to N&N.
Comment 8 Marcus Höpfner CLA 2019-06-25 10:18:12 EDT
(In reply to Lars Vogel from comment #6)
> Marcus, can you create a new bug for using this new factory and push at
> least one Gerrit to use it in platform code.

Yes I can do in a separate change. But this does mean some one can commit the changes from https://bugs.eclipse.org/bugs/show_bug.cgi?id=546990, correct?

Thanks!