JAL-3446 from JAL-3253 ApplicationSingletonProvider
[jalview.git] / src / jalview / io / FileFormats.java
index aadcdb9..7743e17 100644 (file)
@@ -27,6 +27,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import jalview.bin.ApplicationSingletonProvider;
+import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
+
 /**
  * A singleton registry of alignment file formats known to Jalview. On startup,
  * the 'built-in' formats are added (from the FileFormat enum). Additional
@@ -36,24 +39,23 @@ import java.util.Set;
  * @author gmcarstairs
  *
  */
-public class FileFormats
+public class FileFormats implements ApplicationSingletonI
 {
-  private static FileFormats instance = new FileFormats();
+  public static FileFormats getInstance()
+  {
+    return (FileFormats) ApplicationSingletonProvider.getInstance(FileFormats.class);
+  }
+
 
   /*
    * A lookup map of file formats by upper-cased name
    */
-  private static Map<String, FileFormatI> formats;
+  private Map<String, FileFormatI> formats;
 
   /*
    * Formats in this set are capable of being identified by IdentifyFile 
    */
-  private static Set<FileFormatI> identifiable;
-
-  public static FileFormats getInstance()
-  {
-    return instance;
-  }
+  private Set<FileFormatI> identifiable;
 
   /**
    * Private constructor registers Jalview's built-in file formats