+ public void setTechTypePath(String path) {
+ String data;
+ try {
+ data = Files.lines(Paths.get(path), Charset.defaultCharset()).collect(Collectors.joining("\n"));
+ } catch (IOException e) {
+ LOGGER.error("Failed to read contents of file '{}' as {}", path, Charset.defaultCharset(), e);
+ return;
+ }
+
+ try {
+ Simantics.getSession().syncRequest(new WriteTechTypeTable(componentType, data));
+ } catch (DatabaseException e) {
+ LOGGER.error("Failed to write tech type table data to model", e);
+ }
+
+ setTechTypeData(data);
+ }
+
+ public void setTechTypeData(String data) {
+ bodyDataProvider.setData(data);
+ table.refresh(true);
+ }
+
+ public void setComponentType(Resource componentType) {
+ this.componentType = componentType;
+ }