How do I force eclipse to show xml layouts and styles as text?

五迷三道 提交于 2020-02-21 13:24:04

问题


I recently moved up to Eclipse 4.2 (Juno) with ADT 20.0.3.

If I view a layout or a style from an old project Eclipse just shows me its appropriate controls-based editor. I want to edit the syntax-highlighted xml text. I don't see a way to switch the plugin's editor to this mode although it will fallback to it for a layout it chokes on and can't give a WYSIWYG display for.

Any help will be appreciated.

EDIT: This problem turned out to be a side effect of my recent adventures in themeing Eclipse 4.2. Using the Dark Juno theme, the buttons for switching between text and wysiwyg views at the bottom of the editor disappeared entirely (not just the wrong colours, zero screen area). Switching back to the default theme solves the issue.

For the benefit of the Dark Juno author, I noticed Eclipse outputting this on the command line (my ellipses):

~$ eclipse
Failed to find defStyle: listViewStyle
...
Failed to find defStyle: textViewStyle
...
Failed to find defStyle: buttonStyle
...

EDIT 2: This turns out to be a known issue with Dark Juno: https://github.com/eclipse-color-theme/eclipse-ui-themes/issues/11

Does anyone know of a way to make the switch to text without using the buttons that I cannot see?


回答1:


Use Alt+PgDn to switch through the inner tabs.

But we need a permanent solution from Dark Juno. Hope to get a patch soon.

Till then use Alt+PgDn.




回答2:


You can simply choose the tab which shows the raw code instead of the controls from the bottom bar:

Clicking on strings.xml will bring up the syntax highlighted editor, and you can do this for all XMl files.




回答3:


If you use Eclipse on Mac OS X you can use the following key combination ⌥⇟ to switch between sub-tabs.




回答4:


Like this, with XML editor, or text editor, if you like that more.

Hope it helps




回答5:


It still seems to be not fixed. On OS X the shortcut is Fn + Option + Up/Down(effectively Alt + PageUp/PageDown on Windows)




回答6:


To fix the bug of Dark Juno,removing the line:

swt-tab-renderer: url(bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering);

from the CTabFolder element in “com.github.eclipsecolortheme.themes/themes/css/juno.css” .

Reference: https://github.com/rogerdudler/eclipse-ui-themes/issues/11#issuecomment-11439747



来源:https://stackoverflow.com/questions/12534818/how-do-i-force-eclipse-to-show-xml-layouts-and-styles-as-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!