Search in sources :

Example 1 with ITmImporter

use of net.heartsome.cat.ts.tm.importer.extension.ITmImporter in project translationstudio8 by heartsome.

the class TmImporter method runExtension.

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

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

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

Aggregations

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