删除 Eclipse Juno 中的“快速访问”条目

如何从 Juno 的 CDT 工具栏中删除“快速访问”文本条目?我从来不用它,它占用了我笔记本电脑屏幕上宝贵的空间。

35024 次浏览

This bug Make "Quick access" optional and hidden by default covers it. It looks like it is not currently possible, I suggest you add your interest to the bug.

A solution inspired from : https://bugs.eclipse.org/bugs/show_bug.cgi?id=319991

(With eclipse Juno 4.2) Just add this piece of code to your ApplicationWorkbenchWindowAdvisor class and call the method from preWindowOpen().

private void hideQuickAccess() {
UIJob job = new UIJob("hide quick access") {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
IWorkbenchWindow window = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow();
if (window instanceof WorkbenchWindow) {
MTrimBar topTrim = ((WorkbenchWindow) window).getTopTrim();
for (MTrimElement element : topTrim.getChildren()) {
if ("SearchField".equals(element.getElementId())) {
((Control) element.getWidget()).dispose();
break;
}
}
}
return Status.OK_STATUS;
}
};
job.schedule();

It might not work unless changing the accessibility rule of the org.eclipse.e4.ui.model.workbench.source_0.10.1.v20120523-1955.jar. To change this option, go to the Java build Path menu, find the jar, expand it and the option will appear.

NB: I'm not sure about the entailment of this last change, it could be 'not clean'.

Type "toggle toolbar" in the quick access window (yes, that very thing that annoys us) and it'll be gone. C.f.

I looked for an answer to this question because Quick Access took a full row in the toolbar. Instead of removing it (Which requires too much hacking for my taste), I just removed a few toolbar buttons that I didn't use anyway, and the Quick Access shifted up among the rest of the buttons taking only an acceptable amount of space.

There is really no need for that many buttons for any one perspective. They should fit unless your screen is tiny. Customise this in Window -> Customize Prespective...

Check out this plugin: https://github.com/atlanto/eclipse-4.x-filler#hide-quick-access-plug-in

Works with Eclipse Kepler release.

This plug-in adds a functionality to hide/show Quick Access textbox in the main toolbar.

Window ☞ Hide Quick Access

Here is a quick hack which doesn't require any plugin installation, instead you just need to add a few lines to your current layout's CSS file. Works perfectly for me in v4.2.2

Navigate to <ECLIPSE_HOME>/plugins/org.eclipse.platform_<VERSION>/css then open up the CSS file of whichever layout you are using, e.g. mine was e4_default.css. Now append the following snippet to the file:

#SearchField {
visibility:hidden;
}

Now just restart Eclipse and the box is gone.

*Edit

It appears that the layout file e4_basestyle.css is used universally, regardless of your current layout. Thus you should be able to add the above snippet to that file and this fix will be persistent, even if you change layouts.

In Luna this has been fixed.

You can just right click on Quick Access toolbar and click hide to hide it. Refer last few comments in https://bugs.eclipse.org/bugs/show_bug.cgi?id=362420

Solution for Version: Oxygen Release (4.7.0):

  1. Save the icons you are constantly using by dragging them off the "Toolbar" e.g. left/right/under to the Editor.
  2. Then toggle: Window > Appearance > Hide/Show Toolbar Done. :)