(File file)
| 36 | applesoft(new ApplesoftHandler(), "textfile", "*.bas"), assembly(new AssemblyHandler(), "textfile", "*.a", "*.s", "*.asm"), plain(new TextHandler(), "textfile", "*.txt"), hex(new TextHandler(), "textfile", "*.bin", "*.raw"); |
| 37 | |
| 38 | static DocumentType fromFile(File file) { |
| 39 | String name = file.getName(); |
| 40 | String ext = name.substring(name.lastIndexOf('.')).toLowerCase(); |
| 41 | ext = "*" + ext; |
| 42 | for (DocumentType type : values()) { |
| 43 | if (type.extensions.contains(ext)) { |
| 44 | return type; |
| 45 | } |
| 46 | } |
| 47 | return DocumentType.plain; |
| 48 | } |
| 49 | String modeName; |
| 50 | LanguageHandler languageHandler; |
| 51 | List<String> extensions; |