Search in sources :

Example 1 with ITmMatch

use of net.heartsome.cat.ts.tm.match.extension.ITmMatch in project translationstudio8 by heartsome.

the class TmMatcher method runExtension.

/**
	 * 加哉记忆库匹配实现 ;
	 */
private void runExtension() {
    IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(TMMATCH_EXTENSION_ID);
    try {
        for (IConfigurationElement e : config) {
            final Object o = e.createExecutableExtension("class");
            if (o instanceof ITmMatch) {
                ISafeRunnable runnable = new ISafeRunnable() {

                    public void handleException(Throwable exception) {
                        logger.error(Messages.getString("match.TmMatcher.logger1"), exception);
                    }

                    public void run() throws Exception {
                        tmTranslation = (ITmMatch) o;
                    }
                };
                SafeRunner.run(runnable);
            }
        }
    } catch (CoreException ex) {
        logger.error(Messages.getString("match.TmMatcher.logger1"), ex);
    }
}
Also used : CoreException(org.eclipse.core.runtime.CoreException) ISafeRunnable(org.eclipse.core.runtime.ISafeRunnable) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement) ITmMatch(net.heartsome.cat.ts.tm.match.extension.ITmMatch)

Aggregations

ITmMatch (net.heartsome.cat.ts.tm.match.extension.ITmMatch)1 CoreException (org.eclipse.core.runtime.CoreException)1 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1 ISafeRunnable (org.eclipse.core.runtime.ISafeRunnable)1