use of net.heartsome.cat.converter.Converter in project translationstudio8 by heartsome.
the class Activator method start.
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
plugin = this;
Converter docx2Xliff = new Docx2Xliff();
Properties properties = new Properties();
properties.put(Converter.ATTR_NAME, Docx2Xliff.NAME_VALUE);
properties.put(Converter.ATTR_TYPE, Docx2Xliff.TYPE_VALUE);
properties.put(Converter.ATTR_TYPE_NAME, Docx2Xliff.TYPE_NAME_VALUE);
docx2XliffSR = ConverterRegister.registerPositiveConverter(context, docx2Xliff, properties);
Converter xliff2Docx = new Xliff2Docx();
properties = new Properties();
properties.put(Converter.ATTR_NAME, Xliff2Docx.NAME_VALUE);
properties.put(Converter.ATTR_TYPE, Xliff2Docx.TYPE_VALUE);
properties.put(Converter.ATTR_TYPE_NAME, Xliff2Docx.TYPE_NAME_VALUE);
xliff2DocxSR = ConverterRegister.registerReverseConverter(context, xliff2Docx, properties);
}
use of net.heartsome.cat.converter.Converter in project translationstudio8 by heartsome.
the class ConverterTracker method getConverter.
/**
* 根据指定的<code>type</code>获得对应的转换器 *.
* @param type
* 指定的 type
* @return 返回 type 值,及初始化此 model 的转换方向的值对应的转换器。如果 type 对应的转换器不存在,则返回 <code>NULL</code>
*/
public Converter getConverter(String type) {
Converter converter = null;
if (type != null & direction != null) {
ServiceReference[] serviceReferences = converterServiceTracker.getServiceReferences();
for (int i = 0; i < serviceReferences.length; i++) {
String converterType = (String) serviceReferences[i].getProperty(Converter.ATTR_TYPE);
String converterDirection = (String) serviceReferences[i].getProperty(Converter.ATTR_DIRECTION);
if (type.equals(converterType) && direction.equals(converterDirection)) {
converter = (Converter) converterServiceTracker.getService(serviceReferences[i]);
break;
}
}
}
return converter;
}
use of net.heartsome.cat.converter.Converter in project translationstudio8 by heartsome.
the class Activator method start.
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
plugin = this;
Converter wf2Xliff = new Wf2Xliff();
Properties properties = new Properties();
properties.put(Converter.ATTR_NAME, Wf2Xliff.NAME_VALUE);
properties.put(Converter.ATTR_TYPE, Wf2Xliff.TYPE_VALUE);
properties.put(Converter.ATTR_TYPE_NAME, Wf2Xliff.TYPE_NAME_VALUE);
wf2XliffSR = ConverterRegister.registerPositiveConverter(context, wf2Xliff, properties);
Converter xliff2Wf = new Xliff2Wf();
properties = new Properties();
properties.put(Converter.ATTR_NAME, Xliff2Wf.NAME_VALUE);
properties.put(Converter.ATTR_TYPE, Xliff2Wf.TYPE_VALUE);
properties.put(Converter.ATTR_TYPE_NAME, Xliff2Wf.TYPE_NAME_VALUE);
xliff2WfSR = ConverterRegister.registerReverseConverter(context, xliff2Wf, properties);
}
use of net.heartsome.cat.converter.Converter in project translationstudio8 by heartsome.
the class Activator method start.
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
plugin = this;
Converter mq2Xliff = new Mq2Xliff();
Properties properties = new Properties();
properties.put(Converter.ATTR_NAME, Mq2Xliff.NAME_VALUE);
properties.put(Converter.ATTR_TYPE, Mq2Xliff.TYPE_VALUE);
properties.put(Converter.ATTR_TYPE_NAME, Mq2Xliff.TYPE_NAME_VALUE);
mq2XliffSR = ConverterRegister.registerPositiveConverter(context, mq2Xliff, properties);
Converter xliff2Mq = new Xliff2Mq();
properties = new Properties();
properties.put(Converter.ATTR_NAME, Xliff2Mq.NAME_VALUE);
properties.put(Converter.ATTR_TYPE, Xliff2Mq.TYPE_VALUE);
properties.put(Converter.ATTR_TYPE_NAME, Xliff2Mq.TYPE_NAME_VALUE);
xliff2MqSR = ConverterRegister.registerReverseConverter(context, xliff2Mq, properties);
}
use of net.heartsome.cat.converter.Converter in project translationstudio8 by heartsome.
the class Activator method start.
/*
* (non-Javadoc)
*
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext bundleContext) throws Exception {
super.start(bundleContext);
Activator.context = bundleContext;
Converter excel2xliff = new MsExcel2Xliff();
Properties properties = new Properties();
properties.put(Converter.ATTR_NAME, MsExcel2Xliff.NAME_VALUE);
properties.put(Converter.ATTR_TYPE, MsExcel2Xliff.TYPE_VALUE);
properties.put(Converter.ATTR_TYPE_NAME, MsExcel2Xliff.TYPE_NAME_VALUE);
excel2XLIFFSR = ConverterRegister.registerPositiveConverter(context, excel2xliff, properties);
Converter xliff2excel = new Xliff2MsExcel();
properties = new Properties();
properties.put(Converter.ATTR_NAME, Xliff2MsExcel.NAME_VALUE);
properties.put(Converter.ATTR_TYPE, Xliff2MsExcel.TYPE_VALUE);
properties.put(Converter.ATTR_TYPE_NAME, Xliff2MsExcel.TYPE_NAME_VALUE);
xliff2excelSR = ConverterRegister.registerReverseConverter(context, xliff2excel, properties);
plugin = this;
}
Aggregations