6

I'm facing a wierd problem. My eclipse, has a google signin button which is occupying some of the space which I do not want to happen. Initially it had "Sign-in to Google" text along with it. I've followed some blog post and set accordingly to show just the icon (I don't remember that blog post link).

But now, the icon is getting replicating .. it is being shown 12 times. It is actually creating childs :P

I've gone through all the options present in Customize Perspective menu, none of them had this button listed. Can someone help me in removing that google sign button from my perspective? One possible suspect is- my eclipse crashes when I suspend and wakeup my machine.

Picture showing repeated icons

Vinay Bhargav
  • 345
  • 2
  • 11

2 Answers2

4

You can use the Window > Reset Perspective... menu command to reset the perspective to its default state, which might eliminate that toolbar and buttons. If that fails, I would create a new workspace and import the projects into it using File > Import > Existing Projects into Workspace.

If you want to try to salvage your existing workspace, it's possible to do so my manually editing Eclipse's internal file that stores your Workbench layout, but it's a bit tricky. Here are the steps I've followed to eliminate a similar repeated toolbar item:

  1. Exit Eclipse.
  2. Find the Workbench layout file, it's path is <workbench>\.metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi. Make a backup of this file before you touch it - this is essential because it's easy to corrupt the file if you change the wrong things.
  3. Open the file in your favorite XML-aware editor - most packages of Eclipse include the XML editor that works just fine1, but be aware that if you use Eclipse to edit the file you can't have Eclipse open on the workspace that contains the workbench.xmi you want to edit.
  4. Find the section of <trimBars> nodes in the XML; from there you have to determine which <trimBars> node you need to edit. In your case it looks like a vertical one, probably with a side="Right" attribute.
  5. Under the correct <trimBars> node you'll find multiple <chlidren> nodes, each with an elementId attribute that should help you identify it; you're looking for <children> nodes that are identified as something related to the Google plugin.
  6. Delete the <children> nodes that seem related to the unwanted toolbar buttons. In your case, it appears that there is an entire toolbar that you might want to eliminate, so you might want to delete the entire containing <trimBars> node.
  7. Save the file and start Eclipse on that workspace.

1Some packages of Eclipse include EMF tools that will open it in a special XMI editor that does not provide a view of the source, only a structural tree view. Depending on how you like to work with XML, this might be easier than editing raw XML.

E-Riz
  • 28,616
  • 7
  • 83
  • 119
  • I reseted as you described but duplicated buttons still remaining.And I don't want to switch or create another workspaces because I have many preferences in it *(keybinds , validations , server settings , some plugin's settings ,etc:)* . – Cataclysm Dec 02 '14 at 03:20
  • 1
    Workspace settings can easily be exported and imported into another workspace. – E-Riz Dec 02 '14 at 14:16
  • today , I noticed that when my computer (Mac) was force closed unexpectedly and after reopen , there has more buttons before closed. Here is screenshot http://puu.sh/deWlc/d05714251b.png . By the way , how to export or import workspace settings of Eclipse ? sir. – Cataclysm Dec 03 '14 at 03:46
  • And , am I always need to switch workspace when this stupid duplicated buttons appeared? – Cataclysm Dec 03 '14 at 04:59
  • 2
    If you want to copy your workspace settings, you can do this: http://mcuoneclipse.com/2012/04/04/copy-my-workspace-settings/ or you have a look at Oomph:http://www.winklerweb.net/index.php/blog/12-eclipse/20-creating-custom-installations-with-oomph – Calon Dec 03 '14 at 06:37
  • I edited the answer to include some instructions for manually removing toolbars and buttons from the layout file. If you choose to follow them, do so at your own risk and **make sure to backup the file before you start**. – E-Riz Dec 04 '14 at 14:20
1

This is not a perspective but a view. You can hover over that bar with the buttons and click Alt+Shift+F1 to check where this View comes from. Then you can either disable/uninstall the contributing feature (Help -> Installation Details) or check where the feature came from.

If it comes from the IDE, you can open a bug for it. If it is contributed from a third party plugin, contact the developers of that plugin.

There is an eclipse bug concerning duplicate view toolbar buttons in Luna that has recently closed as well. Maybe this solves your problem as well.

Edit: Taken from this bug:

  • root cause is that in Luna 4.4M5 WorkbenchWindowControlContribution.createControl is called twice, the first time with a null value for WorkbenchWindowControlContribution.getWorkbenchWindow() while it is still being created. This is related to what has been reported here https://bugs.eclipse.org/bugs/show_bug.cgi?id=427452
  • second cause is that my createControl(Composite parent) method was calling PlatformUI.getWorkbench().getActiveWorkbenchWindow() instead of WorkbenchWindowControlContribution.getWorkbenchWindow(). This resulted in an attempt to create a new Workbench Window, which recursively calls createControl() again. This has already been reported here https://bugs.eclipse.org/bugs/show_bug.cgi?id=366708
Calon
  • 3,986
  • 1
  • 16
  • 29