MCPcopy Create free account
hub / github.com/badvision/jace / fromFile

Method fromFile

src/main/java/jace/ide/Program.java:38–48  ·  view source on GitHub ↗
(File file)

Source from the content-addressed store, hash-verified

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;

Callers 1

onOpenClickedMethod · 0.95

Calls 1

getNameMethod · 0.65

Tested by

no test coverage detected