]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.graphviz.ui/src/org/simantics/graphviz/ui/GraphvizComponent.java
Externalize strings
[simantics/platform.git] / bundles / org.simantics.graphviz.ui / src / org / simantics / graphviz / ui / GraphvizComponent.java
index 6ba556da09d65f1076bb4108e9e2fb35dcca190d..9bcf9433dd47f328ef4b917401bb73ac3add4bbf 100644 (file)
@@ -69,8 +69,8 @@ public class GraphvizComponent extends Composite {
     }
     
     private void workaroundJava7FocusProblem(Frame frame) {
     }
     
     private void workaroundJava7FocusProblem(Frame frame) {
-        String ver = System.getProperty("java.version");
-        if (ver.startsWith("1.7") || ver.startsWith("1.8")) {
+        String ver = System.getProperty("java.version"); //$NON-NLS-1$
+        if (ver.startsWith("1.7") || ver.startsWith("1.8")) { //$NON-NLS-1$ //$NON-NLS-2$
             try {
                 frame.addWindowListener(new Java7FocusFixListener(this, frame));
             } catch (SecurityException e) {
             try {
                 frame.addWindowListener(new Java7FocusFixListener(this, frame));
             } catch (SecurityException e) {
@@ -90,7 +90,7 @@ public class GraphvizComponent extends Composite {
         Frame frame;
 
         public Java7FocusFixListener(Control control, Frame frame) throws NoSuchMethodException, SecurityException {
         Frame frame;
 
         public Java7FocusFixListener(Control control, Frame frame) throws NoSuchMethodException, SecurityException {
-            this.shellSetActiveControl = Shell.class.getDeclaredMethod("setActiveControl", Control.class);
+            this.shellSetActiveControl = Shell.class.getDeclaredMethod("setActiveControl", Control.class); //$NON-NLS-1$
             this.frame = frame;
             this.control = control;
         }
             this.frame = frame;
             this.control = control;
         }
@@ -137,7 +137,7 @@ public class GraphvizComponent extends Composite {
                     initialized.wait();
             }
         } catch (InterruptedException e) {
                     initialized.wait();
             }
         } catch (InterruptedException e) {
-            throw new Error("GraphvizComponent AWT population interrupted for class " + this, e);
+            throw new Error("GraphvizComponent AWT population interrupted for class " + this, e); //$NON-NLS-1$
         }
     }
 
         }
     }
 
@@ -147,7 +147,7 @@ public class GraphvizComponent extends Composite {
      * @param graph
      */
     public void setGraph(Graph graph) {
      * @param graph
      */
     public void setGraph(Graph graph) {
-        setGraph(graph, "dot");
+        setGraph(graph, "dot"); //$NON-NLS-1$
     }
 
     /**
     }
 
     /**
@@ -210,7 +210,7 @@ public class GraphvizComponent extends Composite {
     
     public void save(File file) throws IOException {
        if (drawable == null) {
     
     public void save(File file) throws IOException {
        if (drawable == null) {
-                       throw new IOException("Nothing to save");
+                       throw new IOException("Nothing to save"); //$NON-NLS-1$
                }
                Graph graph = drawable.getGraph();
                String algo = drawable.getAlgorithm();
                }
                Graph graph = drawable.getGraph();
                String algo = drawable.getAlgorithm();
@@ -222,16 +222,16 @@ public class GraphvizComponent extends Composite {
     }
     
     public String[] getFileExtensions() {
     }
     
     public String[] getFileExtensions() {
-       return new String[]{"*.svg","*.dot","*.eps", "*.jpg", "*.jpeg","*.pdf","*.png","*.ps"};
+       return new String[]{"*.svg","*.dot","*.eps", "*.jpg", "*.jpeg","*.pdf","*.png","*.ps"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
     }
     
     public String[] getFileNames() {
     }
     
     public String[] getFileNames() {
-       return new String[]{"Scalable Vector Graphics Image",  "DOT Image", "Encapsulated PostScript Image","JPG Image","JPG Image","Portable Document Format Image","Portable Network Graphics Image","PostScript Image"};
+       return new String[]{"Scalable Vector Graphics Image",  "DOT Image", "Encapsulated PostScript Image","JPG Image","JPG Image","Portable Document Format Image","Portable Network Graphics Image","PostScript Image"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
     }
     
     public static String getExtension(File file) {
                String filename = file.getName();
     }
     
     public static String getExtension(File file) {
                String filename = file.getName();
-               int index = filename.lastIndexOf(".");
+               int index = filename.lastIndexOf("."); //$NON-NLS-1$
                if (index < 0)
                        return null;
                return filename.substring(index+1).toLowerCase();
                if (index < 0)
                        return null;
                return filename.substring(index+1).toLowerCase();