/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

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