use of org.openlca.jsonld.input.UpdateMode in project olca-app by GreenDelta.
the class JsonImportPage method createControl.
@Override
public void createControl(Composite parent) {
Composite body = new Composite(parent, SWT.NONE);
UI.gridLayout(body, 1);
Group group = new Group(body, SWT.NONE);
group.setText("Update mode");
UI.gridData(group, true, false);
UI.gridLayout(group, 1);
for (UpdateMode mode : mods) {
Button option = new Button(group, SWT.RADIO);
option.setText(getText(mode));
option.setSelection(mode == updateMode);
Controls.onSelect(option, (e) -> {
updateMode = mode;
});
}
setControl(body);
}
use of org.openlca.jsonld.input.UpdateMode in project olca-app by GreenDelta.
the class JsonImportWizard method doRun.
private void doRun(File zip) throws Exception {
UpdateMode mode = settingsPage.updateMode;
var log = LoggerFactory.getLogger(getClass());
log.info("Import JSON LD package {} with update mode = {}", zip, mode);
getContainer().run(true, true, (monitor) -> {
monitor.beginTask(M.Import, IProgressMonitor.UNKNOWN);
try (ZipStore store = ZipStore.open(zip)) {
JsonImport importer = new JsonImport(store, Database.get());
importer.setUpdateMode(mode);
importer.run();
} catch (Exception e) {
throw new InvocationTargetException(e);
}
});
}
Aggregations