fixed text editor
[instantlauncher.git] / src / main / java / eu / svjatoslav / instantlauncher / FileAssociationManager.java
index eefbd80..68f8a91 100755 (executable)
@@ -8,7 +8,7 @@ import eu.svjatoslav.commons.gui.dialog.ExceptionDialog;
 
 public class FileAssociationManager {
 
-    private static final String TEXT_EDITOR = "kwrite";
+    private static final String TEXT_EDITOR = "scribes";
 
     private static final String FILE_INDICATOR = "<FILE>";
 
@@ -39,6 +39,7 @@ public class FileAssociationManager {
         extensionToApplication.put("wmv", new String[] { "vlc", FILE_INDICATOR });
 
         extensionToApplication.put("ods", new String[] { "localc", FILE_INDICATOR });
+        extensionToApplication.put("docx", new String[] { "lowriter", FILE_INDICATOR });
 
     }
 
@@ -56,27 +57,23 @@ public class FileAssociationManager {
 
             final String[] c = new String[commands.length];
 
-            for (int i = 0; i < commands.length; i++) {
-
-                if (commands[i].equals(FILE_INDICATOR)) {
+            for (int i = 0; i < commands.length; i++)
+                if (commands[i].equals(FILE_INDICATOR))
                     c[i] = file.getAbsolutePath();
-                } else {
+                else
                     c[i] = commands[i];
-                }
-            }
 
             try {
                 Runtime.getRuntime().exec(c);
                 InstantLauncher.exitProgram();
 
             } catch (final IOException e) {
-                ExceptionDialog.showException(e);
+                new ExceptionDialog(e);
             }
 
             return true;
-        } else {
+        } else
             return false;
-        }
 
     }