Bug 475480 - PreferencePage.contributeButtons - custom buttons layout problem
Summary: PreferencePage.contributeButtons - custom buttons layout problem
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: 4.5.2   Edit
Assignee: Dariusz Stefanowicz CLA
QA Contact: Brian de Alwis CLA
URL:
Whiteboard:
Keywords: helpwanted
: 482697 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-08-20 08:57 EDT by Dariusz Stefanowicz CLA
Modified: 2016-01-28 12:31 EST (History)
6 users (show)

See Also:
loskutov: review+
Lars.Vogel: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dariusz Stefanowicz CLA 2015-08-20 08:57:43 EDT
I am contributing custom button in my PreferencePage using 
contributeButtons(Composite parent) method.

Javadoc for PreferencePage.contributeButtons method suggest that for each button a subclass contributes, it must also increase the parent's grid layout number of columns by one; that is:   
((GridLayout) parent.getLayout()).numColumns++;


But this has no effect because PreferencePage.createControl method overwrites this value:


contributeButtons(buttonBar);

if (createApplyButton || createDefaultButton) {
   layout.numColumns = 1 + (createApplyButton && createDefaultButton ? 1 : 0);
Comment 1 Brian de Alwis CLA 2015-08-26 15:52:01 EDT
Would you like to contribute a patch?

https://wiki.eclipse.org/Platform_UI/How_to_Contribute
Comment 2 Eclipse Genie CLA 2015-08-30 07:10:23 EDT
New Gerrit change created: https://git.eclipse.org/r/54848
Comment 4 Brian de Alwis CLA 2015-08-30 20:51:17 EDT
Thanks for the fix, Dariusz!
Comment 5 Brian de Alwis CLA 2015-11-24 10:39:05 EST
*** Bug 482697 has been marked as a duplicate of this bug. ***
Comment 6 Brian de Alwis CLA 2015-11-24 10:41:19 EST
Requesting to backport the fix to 4.5.2.
Comment 7 Eclipse Genie CLA 2015-11-24 10:41:33 EST
New Gerrit change created: https://git.eclipse.org/r/61148
Comment 8 Dani Megert CLA 2015-11-24 10:44:24 EST
(In reply to Brian de Alwis from comment #6)
> Requesting to backport the fix to 4.5.2.

Is this a regression? Is it critical enough to backport? Please explain reasons and possible impacts.
Comment 9 Brian de Alwis CLA 2015-11-24 11:33:30 EST
(In reply to Dani Megert from comment #8)
> (In reply to Brian de Alwis from comment #6)
> > Requesting to backport the fix to 4.5.2.
> 
> Is this a regression? Is it critical enough to backport? Please explain
> reasons and possible impacts.

It's a regression to the API claimed in the Javadoc.  There is no impact on existing code. 

I am jumping the gun requesting the backport: no users have requested it, but it's the second identical bug report against 4.5.
Comment 10 Lars Vogel CLA 2015-11-25 01:42:55 EST
+1 for backport from component lead. Fix is save and we are violating our API Javadoc contract.
Comment 11 Dani Megert CLA 2015-11-25 04:14:25 EST
(In reply to Brian de Alwis from comment #9)
> (In reply to Dani Megert from comment #8)
> > (In reply to Brian de Alwis from comment #6)
> > > Requesting to backport the fix to 4.5.2.
> > 
> > Is this a regression? Is it critical enough to backport? Please explain
> > reasons and possible impacts.
> 
> It's a regression to the API claimed in the Javadoc.  There is no impact on
> existing code. 
> 
> I am jumping the gun requesting the backport: no users have requested it,
> but it's the second identical bug report against 4.5.

+1.
Comment 13 Brian de Alwis CLA 2015-11-25 11:16:51 EST
Thanks everybody.  Fixed in 4.5.2.
Comment 14 Brian de Alwis CLA 2016-01-28 12:31:43 EST
Verified in 4.5.2.M20160127-1000