Commit | Line | Data |
---|---|---|
e119a1c1 NR |
1 | package be.nikiroo.jvcard.resources.enums; |
2 | ||
3 | import java.io.IOException; | |
4 | import java.io.Writer; | |
5 | ||
6 | import be.nikiroo.jvcard.resources.Bundles.Bundle; | |
7 | import be.nikiroo.jvcard.resources.Meta; | |
8 | ||
9 | public enum DisplayOption { | |
10 | @Meta(what = "", where = "", format = "coma-separated list of CLF", info = "The format of each line in the contact list") | |
11 | CONTACT_LIST_FORMAT, // | |
12 | @Meta(what = "", where = "", format = "CDIF", info = "The list of details to show in View Contact mode") | |
13 | CONTACT_DETAILS_INFO, // | |
14 | @Meta(what = "", where = "", format = "Integer or nothing for auto", info = "The size of the details' labels") | |
15 | CONTACT_DETAILS_LABEL_WIDTH, // | |
16 | @Meta(what = "", where = "", format = "CLF", info = "The default value of FN if it is not present") | |
17 | CONTACT_DETAILS_DEFAULT_FN, // | |
18 | @Meta(what = "", where = "", format = "TRUE or FALSE", info = "TRUE to force all FNs to be recreated from CONTACT_DETAILS_DEFAULT_FN") | |
19 | CONTACT_DETAILS_SHOW_COMPUTED_FN, // | |
20 | ||
21 | ; | |
22 | ||
23 | /** | |
24 | * Write the header found in the configuration <tt>.properties</tt> file of | |
25 | * this {@link Bundle}. | |
26 | * | |
27 | * @param writer | |
28 | * the {@link Writer} to write the header in | |
29 | * | |
30 | * @throws IOException | |
31 | * in case of IO error | |
32 | */ | |
33 | static public void writeHeader(Writer writer) throws IOException { | |
34 | writer.write("# Display options configuration\n"); | |
35 | writer.write("#\n"); | |
36 | writer.write("# The Contact List Format (CLF) is basically a list of VCF field names\n"); | |
37 | writer.write("# separated by a pipe and optionally parametrised.\n"); | |
38 | writer.write("# The parameters allows you to:\n"); | |
39 | writer.write("# - @x: (the 'x' is the letter 'x') show only a present/not present info\n"); | |
40 | writer.write("# - @n: limit the size to a fixed value 'n'\n"); | |
41 | writer.write("# - @+: expand the size of this field as much as possible\n"); | |
42 | writer.write("#\n"); | |
43 | writer.write("# In case of lists or multiple-fields values, you can select a specific\n"); | |
44 | writer.write("# list or field with:\n"); | |
45 | writer.write("# - FIELD@(0): select the first value in a list\n"); | |
46 | writer.write("# - FIELD@[1]: select the second field in a multiple-fields value\n"); | |
47 | writer.write("#\n"); | |
48 | writer.write("# You can also add a fixed text if it starts with a simple-quote (').\n"); | |
49 | writer.write("#\n"); | |
50 | writer.write("# Example: \"'Contact: |N@10|FN@20|NICK@+|PHOTO@x\"\n"); | |
51 | writer.write("# \n"); | |
52 | writer.write("# \n"); | |
53 | writer.write("# The Contact Details Info Format (CDIF):\n"); | |
54 | writer.write("# - Each detail (separated by a pipe \"|\" character) is visible on its own line\n"); | |
55 | writer.write("# - It is made up of two parts: the label and the linked VCF field (optional),\n"); | |
56 | writer.write("# separated by an equal \"=\", sharp \"#\", plus \"+\" or asterisk \"*\" sign\n"); | |
57 | writer.write("# - \"=FIELD\" will take the preferred value for this field\n"); | |
58 | writer.write("# - \"+FIELD\" will take the preferred value for this field and highlight it\n"); | |
59 | writer.write("# - \"#FIELD\" will take all the values with this field's name\n"); | |
60 | writer.write("# - \"*FIELD\" will take all the values with this field's name, highlighting the preferred one\n"); | |
61 | writer.write("#\n"); | |
62 | writer.write("# Example:\n"); | |
63 | writer.write("# CONTACT_DETAILS_INFO = Phone:=TEL|eMail:=EMAIL\n"); | |
64 | writer.write("#\n"); | |
65 | writer.write("# This will print two lines:\n"); | |
66 | writer.write("# Phone: +32 888 88 88 88\n"); | |
67 | writer.write("# eMail: nobody@nowhere.com\n"); | |
68 | writer.write("#\n"); | |
69 | } | |
70 | } |