]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/utils/SourceLinkUtil.java
Externalize org.simantics.document.linking.ui
[simantics/platform.git] / bundles / org.simantics.document.linking.ui / src / org / simantics / document / linking / utils / SourceLinkUtil.java
index 12c2b5b998aa0fb105f0ce3d879612634dffc9dc..c652f69fa678b834b9809989a3741347d7c27bda 100644 (file)
@@ -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<String> 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$
                                }
                        }
                }