Hiding Duplicate Toolbars Items in Eclipse
Asked Answered
W

5

14

I don't know how, but my STS has got duplicate toolbars items and I am not sure how to remove them. Here is how my duplicated toolbar looks like.

enter image description here

I want to get rid of these. I tried to hide the toolbar but that didn't help. Does anybody have any idea how to get rid of the duplicate ones?

Weathering answered 2/8, 2017 at 8:54 Comment(0)
R
22

I've been having the same problem since upgrading to Oxygen. I haven't been able to reliably reproduce the issue.

The workaround suggested by @howlger has helped and is less intrusive than blowing away the entire workspace:

  1. Close Eclipse.
  2. In the Eclipse workspace directory, delete the .metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi file or just rename it so you can bring it back in case you need to revert.
  3. Open Eclipse.
  4. Rearrange the UI elements to your liking.

This is a pain, but does remove the duplicate elements from toolbars.

I also found that customizing the perspective doesn't work for duplicated items, but does for non-duplicated:

  1. Window -> Perspective -> Customize Perspective...
  2. On the "Tool Bar Visibility" tab, deselect the items that are cluttering up your toolbar.
Reggie answered 12/9, 2017 at 19:4 Comment(2)
had this issue also on eclipse oxygen. Thank you for the hint, worked like a charmIllinois
This is the only thing that has worked for me...at one point of time these duplicate icons were occupying half my screen and this worked perfectly.Diseased
P
6

This appears to be an issue in the core Eclipse platform. While the screenshot shows pretty icons thanks to Darkest Dark, it does not appear related at this time to Darkest Dark plugin as Howlger has indicated. Instead, it appears that duplicate contribution entries appear in the workbench.xmi file. In our testing (I contribute to Darkest Dark), we can see these entries happening in a standalone Eclipse, though haven't been able to track down the root cause yet in where entries get added again to the workbench.xmi.

Interestingly, a user has posted on an old Eclipse bug with what looks like a screenshot of Eclipse Classic exhibiting the same problem today.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=402561

Screenshot from Eclipse Bug

Pullulate answered 19/10, 2017 at 22:0 Comment(1)
I am facing the same issue with 4.7.0 and do not have Darkest Dark Theme installed. But what I have noticed is that some icons get duplicated one more time when I change the laptop from place (e.g. bring laptop from work to home, viceversa) so it could be related to something that changes with the place as well, like IP (don't think so), displays connected (amount/models), ...Hippogriff
R
3

It looks like you have installed the Darkest Dark Theme plug-in. Try to uninstall it.

This closed source plug-in does load-time weaving to patch Java bytecode of the Eclipse platform (for legal reasons, to not have to publish their changes). In contrast of using a public API, load-time weaving patches have to be adapted for each (new) Eclipse version: an error in the plug-in can cause strange behavior of the Eclipse platform.

See also: Keyboard shortcuts in Eclipse Oxygen stopped working

Ricardoricca answered 2/8, 2017 at 9:11 Comment(4)
Just deleting the theme doesn't help, even when reseting the current perspective afterwards. As far as i know only creating a new workspace helps, which can be quite bothersome, depending on how many things have been customized.Intercrop
Btw, I have the same problem with the in oxygen introduced eclipse user storage icon, it has 13 duplicates, annoying as hell. None of the other icons are duplicating.Intercrop
@ScriptKiddy What do you mean with just deleting? Did you uninstall it or disable it? Try to delete the workspace file .metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi instead of creating a new workspace.Ricardoricca
by deleting i meant uninstalling. Will try later, thanks for the info.Intercrop
D
3

I can't say why this happened in the first place, but I do know how to get rid of the duplicate entries. We've experienced the same problem on our Eclipse based product.

Window > New Window

Close the old window and be free of the duplicate actions weighing you down.

Dutra answered 31/1, 2020 at 14:29 Comment(0)
H
2

Not an actual answer, more additional info that I hope will help track down the problem. I am having the same issue with Version: 2018-12 (4.10.0), Build: 20181214-0600.

I opened the workbench.xmi file mentioned above. This was the section I found by searching for "Open a Terminal", which is the tooltip on a repeated icon.

<children xsi:type="menu:ToolBar" xmi:id="_tODFlzriEem5AdcasuU54g" elementId="org.eclipse.tm.terminal.view.ui.toolbar">
  <tags>Draggable</tags>
  <children xsi:type="menu:HandledToolItem" xmi:id="_tODFmDriEem5AdcasuU54g" elementId="org.eclipse.tm.terminal.view.ui.commands.launchToolbar"
       iconURI="platform:/plugin/org.eclipse.tm.terminal.view.ui/icons/eview16/console_view.png" tooltip="Open a Terminal" command="_tOOFADriEem5AdcasuU54g">
    <persistedState key="IIdentifier" value="org.eclipse.tm.terminal.view.ui/org.eclipse.tm.terminal.view.ui.commands.launchToolbar"/>
  </children>
  <children xsi:type="menu:HandledToolItem" xmi:id="_tODFmTriEem5AdcasuU54g" elementId="org.eclipse.tm.terminal.view.ui.commands.launchToolbar"
       iconURI="platform:/plugin/org.eclipse.tm.terminal.view.ui/icons/eview16/console_view.png" tooltip="Open a Terminal" command="_tOOFADriEem5AdcasuU54g">
    <persistedState key="IIdentifier" value="org.eclipse.tm.terminal.view.ui/org.eclipse.tm.terminal.view.ui.commands.launchToolbar"/>
  </children>
  <children xsi:type="menu:HandledToolItem" xmi:id="_tODFmjriEem5AdcasuU54g" elementId="org.eclipse.tm.terminal.view.ui.commands.launchToolbar"
       iconURI="platform:/plugin/org.eclipse.tm.terminal.view.ui/icons/eview16/console_view.png" tooltip="Open a Terminal" command="_tOOFADriEem5AdcasuU54g">
    <persistedState key="IIdentifier" value="org.eclipse.tm.terminal.view.ui/org.eclipse.tm.terminal.view.ui.commands.launchToolbar"/>
  </children>
  <children xsi:type="menu:HandledToolItem" xmi:id="_tODFmzriEem5AdcasuU54g" elementId="org.eclipse.tm.terminal.view.ui.commands.launchToolbar"
       iconURI="platform:/plugin/org.eclipse.tm.terminal.view.ui/icons/eview16/console_view.png" tooltip="Open a Terminal" command="_tOOFADriEem5AdcasuU54g">
    <persistedState key="IIdentifier" value="org.eclipse.tm.terminal.view.ui/org.eclipse.tm.terminal.view.ui.commands.launchToolbar"/>
  </children>
  <children xsi:type="menu:HandledToolItem" xmi:id="_tODFnDriEem5AdcasuU54g" elementId="org.eclipse.tm.terminal.view.ui.commands.launchToolbar"
       iconURI="platform:/plugin/org.eclipse.tm.terminal.view.ui/icons/eview16/console_view.png" tooltip="Open a Terminal" command="_tOOFADriEem5AdcasuU54g">
    <persistedState key="IIdentifier" value="org.eclipse.tm.terminal.view.ui/org.eclipse.tm.terminal.view.ui.commands.launchToolbar"/>
  </children>
  <children xsi:type="menu:HandledToolItem" xmi:id="_tODFnTriEem5AdcasuU54g" elementId="org.eclipse.tm.terminal.view.ui.commands.launchToolbar"
       iconURI="platform:/plugin/org.eclipse.tm.terminal.view.ui/icons/eview16/console_view.png" tooltip="Open a Terminal" command="_tOOFADriEem5AdcasuU54g">
    <persistedState key="IIdentifier" value="org.eclipse.tm.terminal.view.ui/org.eclipse.tm.terminal.view.ui.commands.launchToolbar"/>
  </children>
  <children xsi:type="menu:HandledToolItem" xmi:id="_tODFnjriEem5AdcasuU54g" elementId="org.eclipse.tm.terminal.view.ui.commands.launchToolbar"
       iconURI="platform:/plugin/org.eclipse.tm.terminal.view.ui/icons/eview16/console_view.png" tooltip="Open a Terminal" command="_tOOFADriEem5AdcasuU54g">
    <persistedState key="IIdentifier" value="org.eclipse.tm.terminal.view.ui/org.eclipse.tm.terminal.view.ui.commands.launchToolbar"/>
  </children>
  <children xsi:type="menu:HandledToolItem" xmi:id="_tODFnzriEem5AdcasuU54g" elementId="org.eclipse.tm.terminal.view.ui.commands.launchToolbar"
       iconURI="platform:/plugin/org.eclipse.tm.terminal.view.ui/icons/eview16/console_view.png" tooltip="Open a Terminal" command="_tOOFADriEem5AdcasuU54g">
    <persistedState key="IIdentifier" value="org.eclipse.tm.terminal.view.ui/org.eclipse.tm.terminal.view.ui.commands.launchToolbar"/>
  </children>
</children>
  • Stopped eclipse.
  • Edited this down to one menu:HandledToolItem child.
  • Started eclipse.

When I refreshed workbench.xmi I found this (two icons appear):

<children xsi:type="menu:ToolBar" xmi:id="_FzpBgzrrEemLeYohrjtX4w" elementId="org.eclipse.tm.terminal.view.ui.toolbar">
  <tags>Draggable</tags>
  <children xsi:type="menu:HandledToolItem" xmi:id="_FzpBhDrrEemLeYohrjtX4w" elementId="org.eclipse.tm.terminal.view.ui.commands.launchToolbar"
       iconURI="platform:/plugin/org.eclipse.tm.terminal.view.ui/icons/eview16/console_view.png" tooltip="Open a Terminal" command="_Fzw9IzrrEemLeYohrjtX4w">
    <persistedState key="IIdentifier" value="org.eclipse.tm.terminal.view.ui/org.eclipse.tm.terminal.view.ui.commands.launchToolbar"/>
  </children>
  <children xsi:type="menu:HandledToolItem" xmi:id="_FzpBhTrrEemLeYohrjtX4w" elementId="org.eclipse.tm.terminal.view.ui.commands.launchToolbar"
       iconURI="platform:/plugin/org.eclipse.tm.terminal.view.ui/icons/eview16/console_view.png" tooltip="Open a Terminal" command="_Fzw9IzrrEemLeYohrjtX4w">
    <persistedState key="IIdentifier" value="org.eclipse.tm.terminal.view.ui/org.eclipse.tm.terminal.view.ui.commands.launchToolbar"/>
  </children>
</children>

I notice, also, that the ids have been updated.

John

Hypoderma answered 28/2, 2019 at 0:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.