Search in sources :

Example 11 with Converter

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)
	 * @param context
	 * @throws Exception
	 */
public void start(BundleContext context) throws Exception {
    super.start(context);
    plugin = this;
    // register the converter services
    Converter mif2Xliff = new Mif2Xliff();
    Properties properties = new Properties();
    properties.put(Converter.ATTR_NAME, Mif2Xliff.NAME_VALUE);
    properties.put(Converter.ATTR_TYPE, Mif2Xliff.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, Mif2Xliff.TYPE_NAME_VALUE);
    mif2XliffSR = ConverterRegister.registerPositiveConverter(context, mif2Xliff, properties);
    Converter xliff2Mif = new Xliff2Mif();
    properties = new Properties();
    properties.put(Converter.ATTR_NAME, Xliff2Mif.NAME_VALUE);
    properties.put(Converter.ATTR_TYPE, Xliff2Mif.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, Xliff2Mif.TYPE_NAME_VALUE);
    xliff2MifSR = ConverterRegister.registerReverseConverter(context, xliff2Mif, properties);
}
Also used : Converter(net.heartsome.cat.converter.Converter) Properties(java.util.Properties)

Example 12 with Converter

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)
	 * @param context
	 * @throws Exception
	 */
public void start(BundleContext context) throws Exception {
    plugin = this;
    // register the converter service
    Converter html2Xliff = new Html2Xliff();
    Properties properties = new Properties();
    properties.put(Converter.ATTR_NAME, Html2Xliff.NAME_VALUE);
    properties.put(Converter.ATTR_TYPE, Html2Xliff.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, Html2Xliff.TYPE_NAME_VALUE);
    html2XliffSR = ConverterRegister.registerPositiveConverter(context, html2Xliff, properties);
    Converter xliff2Html = new Xliff2Html();
    properties = new Properties();
    properties.put(Converter.ATTR_TYPE, Xliff2Html.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, Xliff2Html.TYPE_NAME_VALUE);
    properties.put(Converter.ATTR_NAME, Xliff2Html.NAME_VALUE);
    xliff2HtmlSR = ConverterRegister.registerReverseConverter(context, xliff2Html, properties);
}
Also used : Converter(net.heartsome.cat.converter.Converter) Properties(java.util.Properties)

Example 13 with Converter

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 {
    Activator.context = bundleContext;
    Converter idml2XLIFF = new IDML2XLIFF();
    Properties properties = new Properties();
    properties.put(Converter.ATTR_NAME, IDML2XLIFF.NAME_VALUE);
    properties.put(Converter.ATTR_TYPE, IDML2XLIFF.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, IDML2XLIFF.TYPE_NAME_VALUE);
    idml2XLIFFSR = ConverterRegister.registerPositiveConverter(context, idml2XLIFF, properties);
    Converter xliff2IDML = new XLIFF2IDML();
    properties = new Properties();
    properties.put(Converter.ATTR_NAME, XLIFF2IDML.NAME_VALUE);
    properties.put(Converter.ATTR_TYPE, XLIFF2IDML.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, XLIFF2IDML.TYPE_NAME_VALUE);
    xliff2IDMLSR = ConverterRegister.registerReverseConverter(context, xliff2IDML, properties);
}
Also used : Converter(net.heartsome.cat.converter.Converter) Properties(java.util.Properties)

Example 14 with Converter

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)
	 * @param context
	 * @throws Exception
	 */
public void start(BundleContext context) throws Exception {
    plugin = this;
    bundleContext = context;
    // tracker the xml converter service
    String positiveFilter = new AndFilter(new EqFilter(Constants.OBJECTCLASS, Converter.class.getName()), new EqFilter(Converter.ATTR_TYPE, Xml2Xliff.TYPE_VALUE), new EqFilter(Converter.ATTR_DIRECTION, Converter.DIRECTION_POSITIVE)).toString();
    positiveTracker = new ServiceTracker(context, context.createFilter(positiveFilter), new XmlPositiveCustomizer());
    positiveTracker.open();
    String reverseFilter = new AndFilter(new EqFilter(Constants.OBJECTCLASS, Converter.class.getName()), new EqFilter(Converter.ATTR_TYPE, Xliff2Xml.TYPE_VALUE), new EqFilter(Converter.ATTR_DIRECTION, Converter.DIRECTION_REVERSE)).toString();
    reverseTracker = new ServiceTracker(context, context.createFilter(reverseFilter), new XmlReverseCustomize());
    reverseTracker.open();
}
Also used : AndFilter(net.heartsome.cat.converter.util.AndFilter) ServiceTracker(org.osgi.util.tracker.ServiceTracker) Converter(net.heartsome.cat.converter.Converter) EqFilter(net.heartsome.cat.converter.util.EqFilter)

Example 15 with 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 du2Xliff = new Du2Xliff();
    Properties properties = new Properties();
    properties.put(Converter.ATTR_NAME, Du2Xliff.NAME_VALUE);
    properties.put(Converter.ATTR_TYPE, Du2Xliff.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, Du2Xliff.TYPE_NAME_VALUE);
    du2XliffSR = ConverterRegister.registerPositiveConverter(context, du2Xliff, properties);
    Converter xliff2Du = new Xliff2Du();
    properties = new Properties();
    properties.put(Converter.ATTR_NAME, Xliff2Du.NAME_VALUE);
    properties.put(Converter.ATTR_TYPE, Xliff2Du.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, Xliff2Du.TYPE_NAME_VALUE);
    xliff2DuSR = ConverterRegister.registerReverseConverter(context, xliff2Du, properties);
}
Also used : Converter(net.heartsome.cat.converter.Converter) Properties(java.util.Properties)

Aggregations

Converter (net.heartsome.cat.converter.Converter)29 Properties (java.util.Properties)18 AndFilter (net.heartsome.cat.converter.util.AndFilter)6 EqFilter (net.heartsome.cat.converter.util.EqFilter)6 ServiceTracker (org.osgi.util.tracker.ServiceTracker)6 ConverterException (net.heartsome.cat.converter.ConverterException)3 IStatus (org.eclipse.core.runtime.IStatus)3 File (java.io.File)2 IOException (java.io.IOException)2 ValidationStatus (org.eclipse.core.databinding.validation.ValidationStatus)2 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)2 Status (org.eclipse.core.runtime.Status)2 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)2 NavException (com.ximpleware.NavException)1 VTDException (com.ximpleware.VTDException)1 VTDGen (com.ximpleware.VTDGen)1 VTDNav (com.ximpleware.VTDNav)1 XMLModifier (com.ximpleware.XMLModifier)1 FileInputStream (java.io.FileInputStream)1 FileOutputStream (java.io.FileOutputStream)1