| Summary: | Lock the toolbars command not working | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | uls oz <ulasoz2006> | ||||
| Component: | UI | Assignee: | Patrik Suzzi <psuzzi> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | andreix, bartoszpop, benjarobin+eclipse, benken, bsd, dale.asberry, emoffatt, fernando.torres, gautier.desaintmartinlacaze, jonathan.dumont, larry.singer, psuzzi, shashwat.work, torresdyl | ||||
| Version: | 4.6 | Keywords: | helpwanted | ||||
| Target Milestone: | 4.7 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| See Also: |
https://git.eclipse.org/r/65040 https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=8f2f668a3ca69828368913a9b5308be677e6981e |
||||||
| Whiteboard: | |||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 514972 | ||||||
| Attachments: |
|
||||||
|
Description
uls oz
*** Bug 410503 has been marked as a duplicate of this bug. *** Same functionality missing from the toolbar context menu (right-click). The same error is in Luna (4.4.1). With a fresh workspace the tool bars are locked and cannot be unlocked. With a workspace migrated from a previous version the toolbars are not locked. I tried some of these and it now partially works. There was no theme selected. I selected Windows 7 then selected Help/Welcome. I was then able to move the toolbar for a collapsed view. I was still not able to move the perspective bar or unlock other toolbars. Also see Bug 421539 I want to clarify that this is a regression. Shouldn't the priority be higher? The functionality as described in the Mars docs is broken: http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Fttoolbars.htm In our case we have the LockToolBarHandler that calls the CoolBarToTrimManager#setLockLayout(.) , that is an empty body:
@Override
public void setLockLayout(boolean value) {
}
The class implements the interface ICoolBarManager2, extending ICoolBarManager. According the API documents[1] for the latter, we have:
void setLockLayout(boolean value)
Locks or unlocks the layout of the underlying cool bar widget.
So the API is not respected, as the method body is not implementing the functionality.
Note: The method body is empty since the beginning, on 2011-05-04, when the class was firstly created/moved in the current package. So, it was never implemented.
[1] http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjface%2Faction%2FICoolBarManager.html
Please, correct this bug in Mars.SR1 for Windows. It´s not aceptable and a waste of space have a toolbar with 2 lines and half of space empty and can´t do nothing to rearrange it. It appears to resolve changing theme and restarting eclipse... It´s magic ;-) I'm solving this by adding the IPresentationEngine.NO_MOVE tag to all the MToolBar of the window, that are not tagged as TOOLBAR_SEPARATOR. New Gerrit change created: https://git.eclipse.org/r/65040 Please, see attached change. Moving to 4.7, as it plausibly does not fit earlier. This still happens in Eclipse SDK Version: Oxygen (4.7) Build id: I20170406-2000 OS: Windows 10, v.10.0, x86_64 / win32 As suggested by Brian in the comments, I looked at the callers of CSSRenderingUtils#frameMeIfPossible(), which installs the drag handles, to figure out how their logic should change for determining if the drag handles should be installed. As frameMeIfPossible() is called in ToolBarManagerRenderer#createWidget() and ToolControlRenderer#createWidget(), with the current code we can add/remove drag handles only when the ToolControls/ToolBars are created. I suggest adding a new bug to fix the add/remove of the drag handle image after fixing this bug. Created attachment 267733 [details]
anim gif: solution in action
Please see the attached animated gif.
@Brian, thanks for pointing me to the #frameMeIfPossible. Indeed it was pivotal for the solution.
The proposed solution forces the call of CSSRenderingUtils#frameMeIfPossible with a trick:
el.setToBeRendered(false);
el.setToBeRendered(true);
Which forces the call of ToolBarManagerRenderer#createWidgeg(), followed by the call of CSSRenderingUtils#frameMeIfPossible.
Gerrit change https://git.eclipse.org/r/65040 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=8f2f668a3ca69828368913a9b5308be677e6981e |