Search in sources :

Example 6 with AndFilter

use of net.heartsome.cat.converter.util.AndFilter 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 rtf converter service
    String positiveFilter = new AndFilter(new EqFilter(Constants.OBJECTCLASS, Converter.class.getName()), new EqFilter(Converter.ATTR_TYPE, Rtf2Xliff.TYPE_VALUE), new EqFilter(Converter.ATTR_DIRECTION, Converter.DIRECTION_POSITIVE)).toString();
    positiveTracker = new ServiceTracker(context, context.createFilter(positiveFilter), new RtfPositiveCustomizer());
    positiveTracker.open();
    String reverseFilter = new AndFilter(new EqFilter(Constants.OBJECTCLASS, Converter.class.getName()), new EqFilter(Converter.ATTR_TYPE, Xliff2Rtf.TYPE_VALUE), new EqFilter(Converter.ATTR_DIRECTION, Converter.DIRECTION_REVERSE)).toString();
    reverseTracker = new ServiceTracker(context, context.createFilter(reverseFilter), new RtfReverseCustomize());
    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)

Aggregations

Converter (net.heartsome.cat.converter.Converter)6 AndFilter (net.heartsome.cat.converter.util.AndFilter)6 EqFilter (net.heartsome.cat.converter.util.EqFilter)6 ServiceTracker (org.osgi.util.tracker.ServiceTracker)6