Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse - Why the "Show Whitespace" toolbar item is grayed out in the XML editor but not in the Java one?

Xml:

Xml Selected

Java:

Java File Selected

Is it a bug or a feature?

Needless to say the shortcut (Ctrl+Shift+Alt+W) works fine when the XML file is selected.

Software version used:

Eclipse Java EE IDE for Web Developers.

Version: Luna M7 Release (4.4.0M7) Build id: 20140508-1440

like image 768
Mr_and_Mrs_D Avatar asked Jun 23 '14 12:06

Mr_and_Mrs_D


1 Answers

My solution is to use the latest Eclipse version (Mars.1 Release (4.5.1)) which seems to work properly.

The only operations to do for the XML files is to add the button to the toolbar like this:

  1. Use or open the Java EE Perspective
  2. Open any xml file in a project (e.g. blueprint.xml)
  3. Go to menu: Windows-> Perspective -> Customize Perspective
  4. In the opened dialog window, choose the tab Action Set Availability
  5. In the column Available action sets: check the Editor Presentation
  6. Press OK button to close the popup window.

Here is the windows dialog after checking the right option:

Customize Perspective Screenshot

The three buttons appears now in the toolbar, not greyed-out.

UPDATE: However I found that if I open a pom.xml file the button is still greyed-out, but if I open another plain xml (blueprint.xml or one from a test) it is not.

It seems there is a bug with the pom viewer. As a workaround, I created a key shortcut (e.g AltGr + W) and it works in the pom.xml as well with the shortcut.

like image 112
рüффп Avatar answered Sep 22 '22 20:09

рüффп