Bug 547042 - Prefer usage of GridLayoutFactory instead of new GridLayout
Summary: Prefer usage of GridLayoutFactory instead of new GridLayout
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.11   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2019-05-07 08:06 EDT by Lars Vogel CLA
Modified: 2020-08-04 05:31 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2019-05-07 08:06:18 EDT
Looking as several of Markus changes for the new SWT factories I noticed that we should use more GridLayoutFactory to reduce our code.

Example: https://git.eclipse.org/r/#/c/141636/5/bundles/org.eclipse.ui.workbench/Eclipse+UI/org/eclipse/ui/internal/dialogs/SimpleWorkingSetSelectionDialog.java
Comment 1 Lars Vogel CLA 2019-05-07 08:19:21 EDT
Markus, something for you?
Comment 2 Marcus Höpfner CLA 2019-05-14 02:20:00 EDT
Unfortunately there are cases where use of just GridData is much shorter.

Refer to this:
new GridData(FILL_HORIZONTAL) ends in:
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false)

Should we improve GridDataFactory first? Like add a new static method to cover the short hand constructor GridData(int style).

Otherwise we end up in a lot longer code. But on the other hand more explicit (see above example). No "magic" is hidden when using GDF like above.
Comment 3 Lars Vogel CLA 2019-05-14 02:25:55 EDT
+1 for improving the factory. Please open a bug for that.
Comment 4 Marcus Höpfner CLA 2019-05-28 06:50:58 EDT
Done: https://bugs.eclipse.org/bugs/show_bug.cgi?id=547240

I'd suggest to fix this bug 547240 first.
Comment 5 Lars Vogel CLA 2020-06-16 05:40:19 EDT
Marcus, as the factory was improved, can you provide Gerrits for using it? Or shall we close this one and update on demand, whenever we see a need?
Comment 6 Marcus Höpfner CLA 2020-06-16 08:34:06 EDT
I can provide a Gerrit within this bug. Maybe start with o.e.ui.internal.dialogs....
Comment 7 Lars Vogel CLA 2020-07-22 04:19:41 EDT
(In reply to Marcus Höpfner from comment #6)
> I can provide a Gerrit within this bug. Maybe start with
> o.e.ui.internal.dialogs....

+1
Comment 8 Lars Vogel CLA 2020-08-04 05:03:32 EDT
As do not need bugs anymore for cleanups, so if someone wants, please start pushing Gerrits.
Comment 9 Alexander Fedorov CLA 2020-08-04 05:13:22 EDT
> As do not need bugs anymore for cleanups

Is it "official"?
Comment 10 Lars Vogel CLA 2020-08-04 05:23:40 EDT
(In reply to Alexander Fedorov from comment #9)
> > As do not need bugs anymore for cleanups
> 
> Is it "official"?

Yes, the PMC decided that cleanups do not require anymore bugs, unless a committer raises concerns about the size of the change or its possible impact. The only exception is JDT, which decided that they always want to bug also for cleanups.
Comment 11 Alexander Fedorov CLA 2020-08-04 05:31:02 EDT
Thank you Lars, found it [1]

[1] https://www.eclipse.org/lists/eclipse-pmc/msg03372.html