From: Svjatoslav Agejenko Date: Fri, 3 May 2013 08:53:43 +0000 (+0300) Subject: support more file types X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=042dd1a2abe121507daf4afd64193c65c8a9dd7d;p=instantlauncher.git support more file types --- diff --git a/src/main/java/eu/svjatoslav/instantlauncher/FileAssociationManager.java b/src/main/java/eu/svjatoslav/instantlauncher/FileAssociationManager.java index 68f8a91..df40676 100755 --- a/src/main/java/eu/svjatoslav/instantlauncher/FileAssociationManager.java +++ b/src/main/java/eu/svjatoslav/instantlauncher/FileAssociationManager.java @@ -10,38 +10,13 @@ public class FileAssociationManager { private static final String TEXT_EDITOR = "scribes"; - private static final String FILE_INDICATOR = ""; - - public static HashMap extensionToApplication = new HashMap(); + private static final String DOCUMENT_EDITOR = "lowriter"; - public FileAssociationManager() { + private static final String SPREADSHEET_EDITOR = "localc"; - extensionToApplication.put("txt", new String[] { TEXT_EDITOR, FILE_INDICATOR }); - extensionToApplication.put("xml", new String[] { TEXT_EDITOR, FILE_INDICATOR }); - extensionToApplication.put("properties", new String[] { TEXT_EDITOR, FILE_INDICATOR }); - extensionToApplication.put("ini", new String[] { TEXT_EDITOR, FILE_INDICATOR }); - extensionToApplication.put("", new String[] { TEXT_EDITOR, FILE_INDICATOR }); - - extensionToApplication.put("jpg", new String[] { "eog", FILE_INDICATOR }); - extensionToApplication.put("jpeg", new String[] { "eog", FILE_INDICATOR }); - extensionToApplication.put("png", new String[] { "eog", FILE_INDICATOR }); - - extensionToApplication.put("pdf", new String[] { "evince", FILE_INDICATOR }); - - extensionToApplication.put("mp3", new String[] { "banshee", FILE_INDICATOR }); - extensionToApplication.put("ogg", new String[] { "banshee", FILE_INDICATOR }); - - extensionToApplication.put("avi", new String[] { "vlc", FILE_INDICATOR }); - extensionToApplication.put("mkv", new String[] { "vlc", FILE_INDICATOR }); - extensionToApplication.put("ogv", new String[] { "vlc", FILE_INDICATOR }); - extensionToApplication.put("mp4", new String[] { "vlc", FILE_INDICATOR }); - extensionToApplication.put("flv", new String[] { "vlc", FILE_INDICATOR }); - extensionToApplication.put("wmv", new String[] { "vlc", FILE_INDICATOR }); - - extensionToApplication.put("ods", new String[] { "localc", FILE_INDICATOR }); - extensionToApplication.put("docx", new String[] { "lowriter", FILE_INDICATOR }); + private static final String FILE_INDICATOR = ""; - } + public static HashMap extensionToApplication = new HashMap(); public static boolean openFile(final File file) { @@ -77,4 +52,37 @@ public class FileAssociationManager { } + public FileAssociationManager() { + + extensionToApplication.put("txt", new String[] { TEXT_EDITOR, FILE_INDICATOR }); + extensionToApplication.put("xml", new String[] { TEXT_EDITOR, FILE_INDICATOR }); + extensionToApplication.put("properties", new String[] { TEXT_EDITOR, FILE_INDICATOR }); + extensionToApplication.put("ini", new String[] { TEXT_EDITOR, FILE_INDICATOR }); + extensionToApplication.put("", new String[] { TEXT_EDITOR, FILE_INDICATOR }); + + extensionToApplication.put("jpg", new String[] { "eog", FILE_INDICATOR }); + extensionToApplication.put("jpeg", new String[] { "eog", FILE_INDICATOR }); + extensionToApplication.put("png", new String[] { "eog", FILE_INDICATOR }); + + extensionToApplication.put("pdf", new String[] { "evince", FILE_INDICATOR }); + + extensionToApplication.put("mp3", new String[] { "banshee", FILE_INDICATOR }); + extensionToApplication.put("ogg", new String[] { "banshee", FILE_INDICATOR }); + + extensionToApplication.put("avi", new String[] { "vlc", FILE_INDICATOR }); + extensionToApplication.put("mkv", new String[] { "vlc", FILE_INDICATOR }); + extensionToApplication.put("ogv", new String[] { "vlc", FILE_INDICATOR }); + extensionToApplication.put("mp4", new String[] { "vlc", FILE_INDICATOR }); + extensionToApplication.put("flv", new String[] { "vlc", FILE_INDICATOR }); + extensionToApplication.put("wmv", new String[] { "vlc", FILE_INDICATOR }); + + extensionToApplication.put("ods", new String[] { SPREADSHEET_EDITOR, FILE_INDICATOR }); + extensionToApplication.put("xls", new String[] { SPREADSHEET_EDITOR, FILE_INDICATOR }); + extensionToApplication.put("xlsx", new String[] { SPREADSHEET_EDITOR, FILE_INDICATOR }); + + extensionToApplication.put("docx", new String[] { DOCUMENT_EDITOR, FILE_INDICATOR }); + extensionToApplication.put("doc", new String[] { DOCUMENT_EDITOR, FILE_INDICATOR }); + + } + }