X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.district.network.ui%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Fnetwork%2Fui%2Ftechtype%2Ftable%2FTechTypeTable.java;h=f3ba54d9f790491dbe866705e4ff4a9dfe18c4aa;hb=refs%2Fchanges%2F36%2F4436%2F1;hp=eb83c902ddf535c9bcd8ae236de40913d33bf4a6;hpb=ae7fa2cc4cfe235b2a392d6fb7e3038042ac4221;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/techtype/table/TechTypeTable.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/techtype/table/TechTypeTable.java index eb83c902..f3ba54d9 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/techtype/table/TechTypeTable.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/techtype/table/TechTypeTable.java @@ -44,7 +44,7 @@ import org.eclipse.swt.widgets.Text; import org.simantics.Simantics; import org.simantics.db.Resource; import org.simantics.db.exception.DatabaseException; -import org.simantics.district.network.ui.techtype.requests.WriteTechTypeTableRequest; +import org.simantics.district.network.techtype.requests.WriteTechTypeTableRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -196,7 +196,7 @@ public class TechTypeTable extends Composite { public void setTechTypePath(String path) { String data; try { - data = Files.lines(Paths.get(path)).collect(Collectors.joining("\n")); + 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; @@ -208,8 +208,17 @@ public class TechTypeTable extends Composite { 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; + } + } +