]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.image.ui/src/org/simantics/image/ui/CreateImage.java
Externalize strings
[simantics/platform.git] / bundles / org.simantics.image.ui / src / org / simantics / image / ui / CreateImage.java
index f10ada1e154fe375e224f7421206c6997f92068f..f602d31d40a86a691bdd5bb899bee12deb08171d 100644 (file)
@@ -37,20 +37,20 @@ public class CreateImage extends WriteRequest {
     public static Resource getType(ReadGraph graph, ImageSource source) throws DatabaseException {
        ImageResource IMAGE = ImageResource.getInstance(graph);
        String name = source.name.toLowerCase();
-       if(name.endsWith("svg")) return IMAGE.SvgImage;
-       else if(name.endsWith("png")) return IMAGE.PngImage;
-       else if(name.endsWith("jpg") || name.endsWith("jpeg")) return IMAGE.JpegImage;
-       else if(name.endsWith("gif")) return IMAGE.GifImage;
-       else throw new DatabaseException("Unsupported image format " + source.name);
+       if(name.endsWith("svg")) return IMAGE.SvgImage; //$NON-NLS-1$
+       else if(name.endsWith("png")) return IMAGE.PngImage; //$NON-NLS-1$
+       else if(name.endsWith("jpg") || name.endsWith("jpeg")) return IMAGE.JpegImage; //$NON-NLS-1$ //$NON-NLS-2$
+       else if(name.endsWith("gif")) return IMAGE.GifImage; //$NON-NLS-1$
+       else throw new DatabaseException("Unsupported image format " + source.name); //$NON-NLS-1$
     }
     
     public static void claimLiteral(WriteGraph graph, Resource image, ImageSource source) throws DatabaseException {
         String name = source.name.toLowerCase();
-        if (name.endsWith("svg"))
+        if (name.endsWith("svg")) //$NON-NLS-1$
             graph.claimValue(image, new String(source.data), Bindings.STRING);
-        else if (name.endsWith("png") || name.endsWith("jpg") || name.endsWith("jpeg") || name.endsWith("gif"))
+        else if (name.endsWith("png") || name.endsWith("jpg") || name.endsWith("jpeg") || name.endsWith("gif")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
             graph.claimValue(image, source.data, Bindings.BYTE_ARRAY);
-       else throw new DatabaseException("Unsupported image format " + source.name);
+       else throw new DatabaseException("Unsupported image format " + source.name); //$NON-NLS-1$
     }
 
     @Override
@@ -66,7 +66,7 @@ public class CreateImage extends WriteRequest {
        graph.claimLiteral(image, L0.HasName, source.name, Bindings.STRING);
        claimLiteral(graph, image, source);
        graph.claim(parent, L0.ConsistsOf, image);
-       Layer0Utils.addCommentMetadata(graph, "Imported image " + source.name + " " + image.toString());
+       Layer0Utils.addCommentMetadata(graph, "Imported image " + source.name + " " + image.toString()); //$NON-NLS-1$ //$NON-NLS-2$
        return image;
        
 //     if(file.getPath().endsWith("svg")) {