Revize 5ae26965
Přidáno uživatelem Michal Horký před asi 4 roky(ů)
project/Deserializer/src/io/FileWorker.java | ||
---|---|---|
13 | 13 |
import java.util.List; |
14 | 14 |
import java.util.NoSuchElementException; |
15 | 15 |
|
16 |
import javafx.collections.FXCollections; |
|
17 |
import javafx.collections.ObservableList; |
|
18 |
|
|
16 | 19 |
public class FileWorker { |
17 | 20 |
|
21 |
public static ObservableList<String> getAceModes() { |
|
22 |
File dir = new File(FileWorker.class.getResource("/ace/").toExternalForm().substring(6)); // TODO v JAR |
|
23 |
String names[] = dir.list(); |
|
24 |
ObservableList<String> modes = FXCollections.observableArrayList(); |
|
25 |
for (int i = 0; i < names.length; i++) { |
|
26 |
if (names[i].startsWith("mode-")) { |
|
27 |
modes.add(names[i].substring(5, names[i].lastIndexOf('.'))); |
|
28 |
} |
|
29 |
} |
|
30 |
return modes; |
|
31 |
} |
|
32 |
|
|
33 |
public static ObservableList<String> getAceThemes() { |
|
34 |
File dir = new File(FileWorker.class.getResource("/ace/").toExternalForm().substring(6)); // TODO v JAR |
|
35 |
String names[] = dir.list(); |
|
36 |
ObservableList<String> themes = FXCollections.observableArrayList(); |
|
37 |
for (int i = 0; i < names.length; i++) { |
|
38 |
if (names[i].startsWith("theme-")) { |
|
39 |
themes.add(names[i].substring(6, names[i].lastIndexOf('.'))); |
|
40 |
} |
|
41 |
} |
|
42 |
return themes; |
|
43 |
} |
|
44 |
|
|
18 | 45 |
public static PrintStream createRedirectStream() throws FileNotFoundException { |
19 | 46 |
return new PrintStream(new File("jdeserialize_log.txt")); |
20 | 47 |
} |
Také k dispozici: Unified diff
re #7890
Tvora deamonů vyřešena přes použití ACE knihovny. Deamoni se tedy již nevytváří - knihovna se o plynulé zobrazení stará sama. Na základě zákazníkovi prosby zobrazovány i obsahy souborů bez serializovaných objektů, bylo potřeba rozšířit formátování - soubory mohou být opravdu různé, knihovna zvýrazňuje syntaxe u více jak 100 různých formátů.