Search in sources :

Example 21 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 22 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 sdl2Xliff = new Sdl2Xliff();
    Properties properties = new Properties();
    properties.put(Converter.ATTR_NAME, Sdl2Xliff.NAME_VALUE);
    properties.put(Converter.ATTR_TYPE, Sdl2Xliff.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, Sdl2Xliff.TYPE_NAME_VALUE);
    sdl2XliffSR = ConverterRegister.registerPositiveConverter(context, sdl2Xliff, properties);
    Converter xliff2Sdl = new Xliff2Sdl();
    properties = new Properties();
    properties.put(Converter.ATTR_NAME, Xliff2Sdl.NAME_VALUE);
    properties.put(Converter.ATTR_TYPE, Xliff2Sdl.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, Xliff2Sdl.TYPE_NAME_VALUE);
    xliff2SdlSR = ConverterRegister.registerReverseConverter(context, xliff2Sdl, properties);
}
Also used : Converter(net.heartsome.cat.converter.Converter) Properties(java.util.Properties)

Example 23 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 convert service
    Converter ttx2Xliff = new Ttx2Xliff();
    Properties properties = new Properties();
    properties.put(Converter.ATTR_NAME, Ttx2Xliff.NAME_VALUE);
    properties.put(Converter.ATTR_TYPE, Ttx2Xliff.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, Ttx2Xliff.TYPE_NAME_VALUE);
    ttx2XliffSR = ConverterRegister.registerPositiveConverter(context, ttx2Xliff, properties);
    Converter xliff2Ttx = new Xliff2Ttx();
    properties = new Properties();
    properties.put(Converter.ATTR_NAME, Xliff2Ttx.NAME_VALUE);
    properties.put(Converter.ATTR_TYPE, Xliff2Ttx.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, Xliff2Ttx.TYPE_NAME_VALUE);
    xliff2TtxSR = ConverterRegister.registerReverseConverter(context, xliff2Ttx, properties);
}
Also used : Converter(net.heartsome.cat.converter.Converter) Properties(java.util.Properties)

Example 24 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 services
    Converter po2Xliff = new Po2Xliff();
    Properties properties = new Properties();
    properties.put(Converter.ATTR_NAME, Po2Xliff.NAME_VALUE);
    properties.put(Converter.ATTR_TYPE, Po2Xliff.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, Po2Xliff.TYPE_NAME_VALUE);
    po2XliffSR = ConverterRegister.registerPositiveConverter(context, po2Xliff, properties);
    Converter xliff2Po = new Xliff2Po();
    properties = new Properties();
    properties.put(Converter.ATTR_NAME, Xliff2Po.NAME_VALUE);
    properties.put(Converter.ATTR_TYPE, Xliff2Po.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, Xliff2Po.TYPE_NAME_VALUE);
    xliff2PoSR = ConverterRegister.registerReverseConverter(context, xliff2Po, properties);
}
Also used : Converter(net.heartsome.cat.converter.Converter) Properties(java.util.Properties)

Example 25 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 {
    super.start(bundleContext);
    Activator.context = bundleContext;
    Converter pptx2XLIFF = new PPTX2XLIFF();
    Properties properties = new Properties();
    properties.put(Converter.ATTR_NAME, PPTX2XLIFF.NAME_VALUE);
    properties.put(Converter.ATTR_TYPE, PPTX2XLIFF.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, PPTX2XLIFF.TYPE_NAME_VALUE);
    pptx2XLIFFSR = ConverterRegister.registerPositiveConverter(context, pptx2XLIFF, properties);
    Converter xliff2PPTX = new XLIFF2PPTX();
    properties = new Properties();
    properties.put(Converter.ATTR_NAME, XLIFF2PPTX.NAME_VALUE);
    properties.put(Converter.ATTR_TYPE, XLIFF2PPTX.TYPE_VALUE);
    properties.put(Converter.ATTR_TYPE_NAME, XLIFF2PPTX.TYPE_NAME_VALUE);
    xliff2PPTXSR = ConverterRegister.registerReverseConverter(context, xliff2PPTX, properties);
    plugin = this;
}
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