use of net.heartsome.cat.ts.ui.extensionpoint.IConverterCaller in project translationstudio8 by heartsome.
the class NewProjectWizard method runWizardPageExtension.
/**
* 加载扩展向导页 ;
*/
private void runWizardPageExtension() {
// 加载向导扩展
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(PAGE_EXTENSION_ID);
try {
for (IConfigurationElement e : config) {
final Object o = e.createExecutableExtension("class");
if (o instanceof AbstractNewProjectWizardPage) {
ISafeRunnable runnable = new ISafeRunnable() {
public void handleException(Throwable exception) {
logger.error(Messages.getString("wizard.NewProjectWizard.logger1"), exception);
}
public void run() throws Exception {
extensionPages.add((AbstractNewProjectWizardPage) o);
}
};
SafeRunner.run(runnable);
}
}
} catch (CoreException ex) {
logger.error(Messages.getString("wizard.NewProjectWizard.logger1"), ex);
}
// 加载转换器扩展
IConfigurationElement[] config2 = Platform.getExtensionRegistry().getConfigurationElementsFor("net.heartsome.cat.ts.ui.extension.converter");
try {
for (IConfigurationElement e : config2) {
final Object o = e.createExecutableExtension("class");
if (o instanceof IConverterCaller) {
ISafeRunnable runnable = new ISafeRunnable() {
public void handleException(Throwable exception) {
logger.error(Messages.getString("wizard.NewProjectWizard.logger2"), exception);
}
public void run() throws Exception {
convertImpl = (IConverterCaller) o;
}
};
SafeRunner.run(runnable);
}
}
} catch (CoreException ex) {
logger.error(Messages.getString("wizard.NewProjectWizard.logger2"), ex);
}
}
Aggregations