0
私は、(DLTKベースの)Eclipseプラグインから特定のエディタの関連ファイル拡張子をプログラムで取得しようとしています。その理由は、エディタに関連付けられているファイルのインデックスを作成したいだけなので、Eclipse拡張機能を使用してファイル拡張子をエディタに関連付けることができるため、拡張機能のハードコーディングを避ける必要があるからです。Eclipseエディタに関連するファイル拡張子を取得する
例コード:
public boolean isValidPluginFile(ISourceModule sourceModule) {
// currently:
if (sourceModule.getUnderlyingResource().getFileExtension().equals("twig")) {
return true;
}
return false;
// what i would need instead (pseudocode):
List extensions = Somehow.Retrieve.AssociatedExtensionsFor('MyEditorID');
for (String extension : extensions) {
if (sourceModule.getUnderlyingResource().getFileExtension().equals(extension)) {
return true;
}
}
return false;
}
は完璧に動作します、ありがとうございます。 – pulse00