标识符:org.eclipse.jdt.core.codeFormatter
描述:此扩展点提供了一种机制来添加在 Java 编辑器中使用格式化命令时可以使用的代码格式化程序。
配置标记:
<!ELEMENT codeFormatter> <!ATTLIST codeFormatter class CDATA #REQUIRED >
class
定义代码格式化程序实现的类。该类必须是使用 public 0 自变量构造函数实现的 org.eclipse.jdt.core.ICodeFormatter 的 public 实现。示例:
以下是代码格式化程序扩展点的示例:
<extension point="org.eclipse.jdt.core.codeFormatter"> <codeFormatter class="com.example.MyCodeFormatter"/> </extension>
在上面的示例中,格式化命令将调用在 com.example.MyCodeFormatter 中定义的 format 方法。