Community
Participate
Working Groups
The Print tool takes up space but is likely seldom used. In the interest of providing more toolbar space to other plugins, we should consider removing it.
*** Bug 181009 has been marked as a duplicate of this bug. ***
Was there a conclusion on this one? I've been seeing a trend where the Print tool is no longer included in toolbars (Firefox being one). People just don't print much in general and likely even more rarely from Eclipse based apps. For example in WID our print support was always the last to get attention and the task was more around report production rather than straight printing. The only expection might be an RCP app but presumably the could just add it in.
I think e4 is the right timeframe to do stuff like this.
Would be nice to remove the "Print" button for Eclipse 4.3 as default. @Paul, is that something which would be possible?
(In reply to comment #4) > Would be nice to remove the "Print" button for Eclipse 4.3 as default. > @Paul, is that something which would be possible? Not in 4.3. It would have to be done early in Luna. PW
If we remote this, I suggest also to remove the default shortcut, CTRL+P.
Removing outdated target milestone.
(In reply to Lars Vogel from comment #6) > If we remote this, I suggest also to remove the default shortcut, CTRL+P. I revert that statement Ctrl+P is very common for printing. I think only the toolbar button should be removed.
Simple fix would be to remove the following two lines from WorkbenchActionBuilder fileToolBar.add(getPrintItem()); fileToolBar .add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT)); But this would prevent that users can add it again with Window -> Customize Perspective. Any tip where the defaults for the visible toolbar entries are set?
(In reply to Lars Vogel from comment #9) > Simple fix would be to remove the following two lines from > WorkbenchActionBuilder > > fileToolBar.add(getPrintItem()); Why not getPrintItem() and then use setVisible(false) before you add it to the toolbar manager? PW
> Why not getPrintItem() and then use setVisible(false) before you add it to > the toolbar manager? > If I do this I get the following error message if I try to activate it: ---- "Print (Ctrl+P)" cannot be made visible because it is in the unavailable "null" command group. Would you like to switch to the Command Group Availability tab? ------- To test this is created the following Gerrit review: https://git.eclipse.org/r/18503
That error message is part of Bug 378849 PW
Sorry accidently pushed with https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=d0feb8b5efe20dc21de5c45e4b369e903eef4976 Reverted with https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=2b32ff06f55839f5f109e11ffbbf1e76bd581c48 I try to be more careful in the future with direct pushes.
(In reply to Lars Vogel from comment #13) > Sorry accidently pushed with > https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > ?id=d0feb8b5efe20dc21de5c45e4b369e903eef4976 > > Reverted with > https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > ?id=2b32ff06f55839f5f109e11ffbbf1e76bd581c48 > > I try to be more careful in the future with direct pushes. Normally, you should revert it via the change (press the 'Revert Change' button).
> Normally, you should revert it via the change (press the 'Revert Change' > button). Thanks. I used the "Revert" button in EGit. In which tool is the button you mean?
(In reply to Lars Vogel from comment #15) > > Normally, you should revert it via the change (press the 'Revert Change' > > button). > > Thanks. I used the "Revert" button in EGit. In which tool is the button you > mean? The tool you used to push the change in the first place: Gerrit ;-).
Paul, could you do a review of the change and give me a hint why my change does not work? I think you +1 it, but it unfortunately does not hide the button.
It's being switched for a MHandledToolItem in org.eclipse.ui.internal.CoolBarToTrimManager.fill(MToolBar, IContributionManager) but that's not respecting the visible flag. PW
Should be fixed in the org.eclipse.ui.internal.menus.MenuHelper.create*(*) methods. PW
What about the following solution: https://git.eclipse.org/r/#/c/23420 I've tested it on my Windows PC: 1. Print icon is gone from the main tool bar 2. CTRL+P and File->Print still work fine 3. No exceptions Would this be an appropriate solution for this bug?
(In reply to Dmitry Spiridenok from comment #20) > Would this be an appropriate solution for this bug? No, we want allow users to add it again, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=180308#c19 for a hint for the correct solution together with my patch.
(In reply to Lars Vogel from comment #21) > No, we want allow users to add it again, see > https://bugs.eclipse.org/bugs/show_bug.cgi?id=180308#c19 for a hint for the > correct solution together with my patch. So you want users to be able to bring it back via "Customize Perspective" menu? I was missing this part of requirements. I've seen the hint for MenuHelper create*() methods. However they looked too generic to me to disable some specific button there. I'll try some other solutions suggested in this thread.
Fixed with https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=27eaeb2f602d4c21eda482bd7cb882a41256421c
Verified in Build id: I20140402-0100
I can no longer bring back the icon into my toolbar. Either the underlying problem ('null' command group) needs to be fixed or this change needs to be reverted for M7.
Created attachment 241673 [details] Screenshot of the problem
Paul, what are the plans for the CustomizePerspectiveDialog? It feels to me that the deep embedded assumption that ActionGroup/ Command Groups are present makes it very, very hard to fix it. Maybe if we remove this from the dialog, we can work on the model?
(In reply to Lars Vogel from comment #27) > Paul, what are the plans for the CustomizePerspectiveDialog? It feels to me > that the deep embedded assumption that ActionGroup/ Command Groups are > present makes it very, very hard to fix it. Maybe if we remove this from the > dialog, we can work on the model? The first thing to do is fix the validation. If the object in question (in this case, contributed through the WorkbenchActionBuilder) is not part of a group, why is the validation tripping it up? PW
This needs to be pulled as I don't think bug 393391 will make it into Luna. Lars, can you please do this (or fix the other bug ;-).
(In reply to Dani Megert from comment #29) > This needs to be pulled as I don't think bug 393391 will make it into Luna. > > Lars, can you please do this (or fix the other bug ;-). Will do. After 18:00 CET
(In reply to Lars Vogel from comment #30) > (In reply to Dani Megert from comment #29) > > This needs to be pulled as I don't think bug 393391 will make it into Luna. > > > > Lars, can you please do this (or fix the other bug ;-). I removed the part which sets the print button to invisible but left the fix in which allows to handle visible. https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=8d6cb1423760b1f2c150d959e3eb9eb6d1357da2
(In reply to Lars Vogel from comment #31) > (In reply to Lars Vogel from comment #30) > > (In reply to Dani Megert from comment #29) > > > This needs to be pulled as I don't think bug 393391 will make it into Luna. > > > > > > Lars, can you please do this (or fix the other bug ;-). > > I removed the part which sets the print button to invisible but left the fix > in which allows to handle visible. > > https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > ?id=8d6cb1423760b1f2c150d959e3eb9eb6d1357da2 Thanks.
https://git.eclipse.org/r/40354
(In reply to Lars Vogel from comment #33) > https://git.eclipse.org/r/40354 Unfortunately this is still blocked by the CPD as such a disabled action cannot be enabled in CPD.
(In reply to Lars Vogel from comment #34) > (In reply to Lars Vogel from comment #33) > > https://git.eclipse.org/r/40354 > > Unfortunately this is still blocked by the CPD as such a disabled action > cannot be enabled in CPD. This is most likely not CPD issue, but the problem of the WorkbenchActionBuilder contributions which are still living in "pre e4" world. They work well as long as they are visible by default, but don't if they are hidden. Try to enable "Pin editor" action - same issue on latest nightly BUT once you set the General->Editors->Close automatically and restart Eclipse, the toolbar button enablement/disablement starts to work. The common issue is that ContributionItem.setVisible() is the "legacy" API AFAIK, e4 & CPD expect that the "hidden" toolbar buttons are added via WorkbenchPage.addHiddenItems() and WorkbenchPage.removeHiddenItems().
While debugging bug 445538 and bug 402429 patches I'm stumbled on a pretty simple way to fix this bug. The solution is *much* easier as expected: if we just use our own extension points we can simply disable the "print" button, see how JDT does it eclipse.jdt.ui/org.eclipse.jdt.ui/plugin.xml: <extension point="org.eclipse.ui.perspectiveExtensions"> <perspectiveExtension targetID="*"> <hiddenToolBarItem id="org.eclipse.jdt.ui.actions.OpenProjectWizard"> </hiddenToolBarItem> </perspectiveExtension> </extension> This way it just works (with all the fixes for bug 420956 on HEAD it can be disabled/enabled in CPD without any issues). Patch follows.
New Gerrit change created: https://git.eclipse.org/r/42365
New Gerrit change created: https://git.eclipse.org/r/42474
Gerrit change https://git.eclipse.org/r/42365 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=208f740a4410cbe21fd028b9308cdccb9498e191
.
Andrey thanks for the fix. Please also provide a N&N entry.
(In reply to Lars Vogel from comment #41) > Andrey thanks for the fix. Please also provide a N&N entry. The important part of the entry is to describe how to get it back.
(In reply to Dani Megert from comment #42) > (In reply to Lars Vogel from comment #41) > > Andrey thanks for the fix. Please also provide a N&N entry. > > The important part of the entry is to describe how to get it back. Please review N&N notes: https://git.eclipse.org/r/42965
(In reply to Andrey Loskutov from comment #43) > (In reply to Dani Megert from comment #42) > > (In reply to Lars Vogel from comment #41) > > > Andrey thanks for the fix. Please also provide a N&N entry. > > > > The important part of the entry is to describe how to get it back. > > Please review N&N notes: > https://git.eclipse.org/r/42965 Submitted with http://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=69d120bc05da10825db66d6ea3d6d7c174efb60a
This requires a reset of the perspective for me in4.5.0.N20150315-1630. I think that is fine.