Commit | Line | Data |
---|---|---|
e119a1c1 NR |
1 | package be.nikiroo.jvcard.resources.bundles; |
2 | ||
3 | import java.io.IOException; | |
4 | import java.io.Writer; | |
5 | ||
6 | import be.nikiroo.jvcard.resources.Bundles; | |
7 | import be.nikiroo.jvcard.resources.Bundles.Bundle; | |
8 | import be.nikiroo.jvcard.resources.Bundles.Target; | |
9 | import be.nikiroo.jvcard.resources.enums.ColorOption; | |
10 | ||
11 | /** | |
12 | * All colour information must come from here. | |
13 | * | |
14 | * @author niki | |
15 | * | |
16 | */ | |
17 | public class ColorBundle extends Bundle<ColorOption> { | |
18 | public ColorBundle() { | |
19 | new Bundles().super(ColorOption.class, Target.colors); | |
20 | } | |
21 | ||
22 | @Override | |
23 | protected void writeHeader(Writer writer) throws IOException { | |
24 | ColorOption.writeHeader(writer); | |
25 | } | |
26 | ||
27 | @Override | |
28 | protected void writeValue(Writer writer, ColorOption id) throws IOException { | |
47d06cf3 NR |
29 | String name = id.name() + "_FG"; |
30 | String value = ""; | |
31 | if (map.containsKey(name)) | |
32 | value = map.getString(name).trim(); | |
e119a1c1 | 33 | |
47d06cf3 | 34 | writeValue(writer, name, value); |
e119a1c1 | 35 | |
47d06cf3 NR |
36 | name = id.name() + "_BG"; |
37 | value = ""; | |
38 | if (map.containsKey(name)) | |
39 | value = map.getString(name).trim(); | |
e119a1c1 | 40 | |
47d06cf3 | 41 | writeValue(writer, name, value); |
e119a1c1 NR |
42 | } |
43 | } |