导出Eclipse XML格式规则?

Chr*_*wes 6 eclipse text-formatting xml-formatting eclipse-wtp

有没有办法在Eclipse 3.5 Galileo(Java EE Package)Window > Preferences下导出Dialog XML > XML Files > Editor中定义的设置?Eclipse存储这些设置的位置是什么?

现在我得到eclipse_xml_format.epf了以下内容

/instance/org.eclipse.wst.xml.core/lineWidth=120
/instance/org.eclipse.wst.xml.core/indentationChar=space
/instance/org.eclipse.wst.xml.core/indentationSize=4
Run Code Online (Sandbox Code Playgroud)

但是我无法导入这个文件!

Von*_*onC 10

记录这些XML设置的文件是:

<workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.wst.xml.core.prefs
Run Code Online (Sandbox Code Playgroud)

那是:

  • org.eclipse.wst.xml.core.prefs,
  • org.eclipse.core.runtime\.settingsdirectorty
  • 您的工作区

因此,即使您无法直接导出它们,也可以至少将该文件与另一个工作区设置文件复制/合并,然后重新导入XML设置;


话虽如此,如果您导出所有首选项,它们将保存在您选择的.epf文件中.

在此输入图像描述

所有开头的行/instance/org.eclipse.wst.xml.core都很有趣:

/instance/org.eclipse.wst.xml.core/indentationChar=space
Run Code Online (Sandbox Code Playgroud)

因此,您可以删除所有其他行,然后仅使用其中的XML设置重新导入此epf文件.

注意:您的"清洗"导出文件重新导入(至少eclipse3.5),它包含UST行file_export_version=3.0(在任何地方.epf文件).

#Thu Mar 11 13:33:16 CET 2010
/instance/org.eclipse.wst.xml.core/lineWidth=119
/instance/org.eclipse.wst.xml.core/indentationChar=space
/instance/org.eclipse.wst.xml.core/indentationSize=4
file_export_version=3.0
Run Code Online (Sandbox Code Playgroud)

将成功重新导入