use of net.heartsome.cat.ts.ui.docx.dialog.ExportExternalDialog in project translationstudio8 by heartsome.
the class ExportExternalHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Shell shell = HandlerUtil.getActiveShell(event);
if (!initExportConfig(event)) {
return null;
}
config.setShell(shell);
ExportExternalDialog dialog = new ExportExternalDialog(config);
if (Dialog.OK == dialog.open()) {
if (config.getExportType() == ExportExternal.EXPORT_HSPROOF) {
try {
config.doExport();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
ProgressMonitorDialog progressDialog = new ProgressMonitorDialog(shell);
try {
progressDialog.run(true, true, new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
config.setMonitor(monitor);
try {
config.doExport();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
return null;
}
Aggregations