import org.simantics.selectionview.SelectionViewResources;
import org.simantics.structural.stubs.StructuralResource2;
import org.simantics.structural2.utils.StructuralUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class ComponentTypeCommands {
+ private static final Logger LOGGER = LoggerFactory.getLogger(ComponentTypeCommands.class);
+
public static void applyCode(WriteGraph g, Resource componentType, String code) throws DatabaseException {
StructuralResource2 STR = StructuralResource2.getInstance(g);
g.claimLiteral(componentType, STR.ProceduralComponentType_code, code, Bindings.STRING);
Resource object = getAssertedObject(g, type, relation);
if(object == null) {
- System.err.println("Didn't find assertion for " + NameUtils.getSafeName(g, relation) +
+ LOGGER.warn("Didn't find assertion for " + NameUtils.getSafeName(g, relation) +
" in " + NameUtils.getSafeName(g, type) + ".");
return;
}
Resource object = getAssertedObject(g, type, relation);
if(object == null) {
- System.err.println("Didn't find assertion for " + NameUtils.getSafeName(g, relation) +
+ LOGGER.warn("Didn't find assertion for " + NameUtils.getSafeName(g, relation) +
" in " + NameUtils.getSafeName(g, type) + ".");
return;
}
public static void setUnit(WriteGraph graph, Resource type, Resource relation, String unit) throws DatabaseException {
Resource object = getAssertedObject(graph, type, relation);
if (object == null) {
- System.err.println("Didn't find assertion for " + NameUtils.getSafeName(graph, relation) +
+ LOGGER.warn("Didn't find assertion for " + NameUtils.getSafeName(graph, relation) +
" in " + NameUtils.getSafeName(graph, type) + ".");
return;
}
public static void setRange(WriteGraph graph, Resource type, Resource relation, String newRange) throws DatabaseException {
Resource object = getAssertedObject(graph, type, relation);
if (object == null) {
- System.err.println("Didn't find assertion for " + NameUtils.getSafeName(graph, relation) +
+ LOGGER.warn("Didn't find assertion for " + NameUtils.getSafeName(graph, relation) +
" in " + NameUtils.getSafeName(graph, type) + ".");
return;
}
Datatype newDatatype = TypeConversion.convertSCLTypeToDatatype(newSCLType);
if(newDatatype == null) {
- System.err.println("Couldn't convert default value to <" + newSCLType + ">.");
+ LOGGER.warn("Couldn't convert default value to <" + newSCLType + ">.");
return null;
}
Binding newBinding = Bindings.getBinding(newDatatype);
Resource type, Resource relation, String newSCLType) throws DatabaseException {
Resource object = getAssertedObject(g, type, relation);
if(object == null) {
- System.err.println("Didn't find assertion for " + NameUtils.getSafeName(g, relation) +
+ LOGGER.warn("Didn't find assertion for " + NameUtils.getSafeName(g, relation) +
" in " + NameUtils.getSafeName(g, type) + ".");
return;
}