Search in sources :

Example 1 with ConverterBean

use of net.heartsome.cat.converter.util.ConverterBean in project translationstudio8 by heartsome.

the class FileFormatUtils method getExtensions.

/**
	 * 得到转换器支持的所有文件类型的拓展名
	 * @return ;
	 */
public static String[] getExtensions() {
    List<ConverterBean> list = MODEL.getSupportTypes();
    checkAutomaticOO(list);
    ArrayList<String> FileFormats = new ArrayList<String>();
    for (ConverterBean bean : list) {
        String[] extensions = bean.getExtensions();
        for (String extension : extensions) {
            FileFormats.add(extension);
        }
    }
    return FileFormats.toArray(new String[] {});
}
Also used : ConverterBean(net.heartsome.cat.converter.util.ConverterBean) ArrayList(java.util.ArrayList)

Example 2 with ConverterBean

use of net.heartsome.cat.converter.util.ConverterBean in project translationstudio8 by heartsome.

the class FileFormatUtils method checkAutomaticOO.

/**
	 * 检查是否启用 Open Office
	 */
private static void checkAutomaticOO(List<ConverterBean> list) {
    IPreferencesService service = Platform.getPreferencesService();
    String qualifier = Activator.getDefault().getBundle().getSymbolicName();
    boolean automaticOO = service.getBoolean(qualifier, IPreferenceConstants.AUTOMATIC_OO, false, null);
    if (!automaticOO) {
        list.remove(new ConverterBean("MS Office Document to XLIFF Conveter", null));
    }
}
Also used : ConverterBean(net.heartsome.cat.converter.util.ConverterBean) IPreferencesService(org.eclipse.core.runtime.preferences.IPreferencesService)

Aggregations

ConverterBean (net.heartsome.cat.converter.util.ConverterBean)2 ArrayList (java.util.ArrayList)1 IPreferencesService (org.eclipse.core.runtime.preferences.IPreferencesService)1