X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.document.linking.ui%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Flinking%2Futils%2FSourceLinkUtil.java;h=c652f69fa678b834b9809989a3741347d7c27bda;hp=12c2b5b998aa0fb105f0ce3d879612634dffc9dc;hb=8783f9ee2b67f83160d88f43a7aef02a6b25f955;hpb=6431ba9c664c0b3c65c486397f610a514f246416 diff --git a/bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/utils/SourceLinkUtil.java b/bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/utils/SourceLinkUtil.java index 12c2b5b99..c652f69fa 100644 --- a/bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/utils/SourceLinkUtil.java +++ b/bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/utils/SourceLinkUtil.java @@ -45,9 +45,9 @@ public class SourceLinkUtil { Resource link = null; DependencyCheckResult result = checkDependecies(graph, document, instance); if (result == DependencyCheckResult.NoLocationModel) - throw new DatabaseException("Location of document link is not part of a model."); + throw new DatabaseException(Messages.SourceLinkUtil_DatabaseExceptionLocNotModelPart); if (result == DependencyCheckResult.DifferentModel) { - throw new DatabaseException("Location of document link and document are in different models, document link cannot be created."); + throw new DatabaseException(Messages.SourceLinkUtil_DatabaseExceptionDocumentInDifferentModel); } if (result == DependencyCheckResult.NoReferenceModel) { //referred document and location are not in the same model, create an URI reference. @@ -76,7 +76,7 @@ public class SourceLinkUtil { } public static Resource createInstanceSource(WriteGraph graph, Resource reference, Resource location) throws DatabaseException { - return createInstanceSource(graph, reference, location, ""); + return createInstanceSource(graph, reference, location, ""); //$NON-NLS-1$ } public static Resource createInstanceSource(WriteGraph graph, Resource reference, Resource location, String comment) throws DatabaseException { @@ -107,7 +107,7 @@ public class SourceLinkUtil { } public static Resource createInstanceSource(WriteGraph graph, String reference, Resource location) throws DatabaseException { - return createInstanceSource(graph, reference, location, ""); + return createInstanceSource(graph, reference, location, ""); //$NON-NLS-1$ } public static Resource createInstanceSource(WriteGraph graph, String reference, Resource location, String comment) throws DatabaseException { @@ -138,7 +138,7 @@ public class SourceLinkUtil { } public static Resource createFunctionalSource(WriteGraph graph, Resource reference, Resource location, Resource relation) throws DatabaseException { - return createFunctionalSource(graph, reference, location, relation, ""); + return createFunctionalSource(graph, reference, location, relation, ""); //$NON-NLS-1$ } @@ -173,7 +173,7 @@ public class SourceLinkUtil { } public static Resource createFunctionalSource(WriteGraph graph, String reference, Resource location, Resource relation) throws DatabaseException { - return createFunctionalSource(graph, reference, location, relation, ""); + return createFunctionalSource(graph, reference, location, relation, ""); //$NON-NLS-1$ } @@ -407,7 +407,7 @@ public class SourceLinkUtil { } else if (value instanceof Object[]) { return Arrays.toString((Object[])value); } else { - return "TODO: Array " + value.getClass().getSimpleName(); + return "TODO: Array " + value.getClass().getSimpleName(); //$NON-NLS-1$ } } else { return value.toString(); @@ -436,15 +436,15 @@ public class SourceLinkUtil { } public static String getCustomizedString(ReadGraph graph, Resource document, List annotationContent) throws DatabaseException{ - String label = ""; + String label = ""; //$NON-NLS-1$ Variable doc = graph.adapt(document, Variable.class); for (String path : annotationContent) { - if (path.startsWith("\"") && path.endsWith("\"")) { - label += path.substring(1,path.length()-1)+ " "; + if (path.startsWith("\"") && path.endsWith("\"")) { //$NON-NLS-1$ //$NON-NLS-2$ + label += path.substring(1,path.length()-1)+ " "; //$NON-NLS-1$ } else { Variable v = PredefinedVariables.getInstance().getVariable(graph, path, null, doc); if (v != null) { - label += v.getValue(graph) + " "; + label += v.getValue(graph) + " "; //$NON-NLS-1$ } } }