PageRenderTime 103ms CodeModel.GetById 81ms app.highlight 18ms RepoModel.GetById 1ms app.codeStats 0ms

/src/mpv5/globals/Headers.java

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/
Java | 67 lines | 55 code | 8 blank | 4 comment | 4 complexity | c3ff8c191c64d9fe2fb500c5ae0bb256 MD5 | raw file
 1package mpv5.globals;
 2
 3import mpv5.i18n.LanguageManager;
 4import mpv5.logging.Log;
 5
 6public enum Headers {
 7//empty columnnames not allowed
 8    SEARCH_DEFAULT(new String[]{"Internal ID", "A", "B"}),
 9    CONTACT_DEFAULT(new String[]{"Internal ID", "ID", "Name", "City"}),
10    CONTACT_DETAILS(new String[]{"Internal ID", "ID", "Title", "Prename", "Name", "Street", "Zip", "City", "Mainphone", "Fax", "Mobilephone", "Workphone", "Company", "Mailaddress", "Website", "Notes", "Taxnumber"}),
11    USER_DEFAULT(new String[]{"Internal ID", "ID", "User Name", "Mail", "Last logged in"}),
12    USER_DETAILS(new String[]{"Internal ID", "User Name", "Fullname", "Mail", "Enabled", "Logged in"}),
13    BABELFISH(new String[]{"Component", "Language Value", "New Value"}),
14    ITEM_DEFAULT(new String[]{"Internal ID", "ID", "Date", "Net Value"}),
15    ITEM_DETAIL(new String[]{"Internal ID", "ID", "Date", "Value"}),
16    FILE_REFERENCES(new String[]{"Internal ID", "Filename", "Date", "Description", "Size", "Type"}),
17    HISTORY(new String[]{"Internal ID", "Description", "User", "Group", "Date"}),
18    IMPORT(new String[]{"Internal ID", "Import", "Type", "Name", "Data"}),
19    JOURNAL(new String[]{"Internal ID", "Name", "Surname", "Street", "City", "Country", "Date", "Group", "Account", "Number", "Type", "Status", "Net", "Tax","Brut","Revenue"}),
20    TRASHBIN(new String[]{"Type", "Internal ID", "Description"}),
21    PRODUCT_DEFAULT(new String[]{"Internal ID", "Name", "Number", "Description"}),
22    SUBITEMS(new String[]{"Internal ID", "Nr", "Count", "Measure", "Text", "Netto Price", "Tax Rate", "Total Price", "Tax value", "Net 2", "Product ID", "A", "C", "Link", "Optional", "Discount", "Discount Value"}),
23    TEMPLATES(new String[]{"Name", "Type", "Group"}),
24    MAILTEMPLATES(new String[]{"Name", "Description", "Group"}),
25    SCHEDULE_LIST(new String[]{"Item ID", "Interval (Months)", "End date", "Added by"}),
26    SCHEDULE_PANEL(new String[]{"IDS","Schedule ID", "Date","Type"}),
27    ACTIVITY(new String[]{"Internal ID", "Nr", "Date", "Count", "Measure", "Text", "Netto Price", "Tax Rate", "Total Price", "Product", "Name", "object"}),
28    EXPENSE(new String[]{"Number", "Description", "Account", "Value", "Tax Rate", "Paid"}),
29    LIBRARIEST(new String[]{"File", "Description", "License", "Author"}), 
30    MASSPRINT(new String[]{"Object", "Name", "Item-Type", "Date Added"});
31
32    private Headers(String[] header) {
33        this.header = header;
34    }
35    private String[] header;
36
37    public String[] getValue() {
38      
39           if (LanguageManager.isReady()) {
40            for (int i = 0; i < header.length; i++) {
41                try {
42                    header[i] = LanguageManager.getBundle().getString(this.name() + "." + i);
43                } catch (Exception e) {
44                    Log.Debug(this, e.getMessage());
45                }
46            }
47        }
48        
49        return header;
50    }
51
52    public void setValue(String[] header) {
53        this.header = header;
54    }
55
56    /**
57     * Print out the values and their keys
58     */
59    public void printValues(){
60         for (int k = 0; k < this.values().length; k++) {
61            Headers data = this.values()[k];
62            for (int i = 0; i < data.getValue().length; i++) {
63                Log.Print(data.name() + "." + i + "=" + data.getValue()[i]);
64            }
65        }
66    }
67}