eclipse插件 - 像java文件一样处理非java扩展文件 [英] eclipse plugin - treat non java extension file like a java file
问题描述
包含java代码。 JavaCore.createCompilationUnitFrom()仅接受扩展名为.java的文件。 JavaCore有JAVA_SOURCE_CONTENT_TYPE,它返回它被视为
Java源文件的扩展名。
我的问题是如何在此列表中添加.xyz?我希望JavaCore将.xyz扩展名的文件视为java源文件。
任何指针都将非常有用。
bug 71460 已经在eclipse3.1中引用了类似java的源的不同扩展的支持。
bug 121715 提到eclipse3.2(用于支持 .aj
文件包含Java源码):
< content-type id =ajSourcename =AspectJ源文件
base-type =org.eclipse。 jdt.core.javaSource
file-extensions =aj/>
We are developing an eclipse plugin and we have an extension like say, ".xyz" but it actually contains java code. JavaCore.createCompilationUnitFrom() accepts only files with extension ".java". JavaCore has JAVA_SOURCE_CONTENT_TYPE which returns the extensions that it treats as Java source files.
My questions is How do I add ".xyz" to this list ? I want JavaCore to treat files of ".xyz" extension as java source files.
Any pointers would be very helpful.
The bug 71460 has introduced support for different extension for java-like sources in eclipse3.1.
The bug 121715 mentions for eclipse3.2, (for supporting .aj
files as containing Java source):
<content-type id="ajSource" name="AspectJ Source File"
base-type="org.eclipse.jdt.core.javaSource"
file-extensions="aj"/>
这篇关于eclipse插件 - 像java文件一样处理非java扩展文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!