1 31 32 package org.opencms.workflow; 33 34 import org.opencms.file.CmsRequestContext; 35 import org.opencms.i18n.A_CmsMessageBundle; 36 import org.opencms.i18n.CmsLocaleManager; 37 import org.opencms.i18n.I_CmsMessageBundle; 38 39 import java.util.Locale ; 40 41 50 public final class Messages extends A_CmsMessageBundle { 51 52 53 public static final String ERR_BAD_TASKNAME_4 = "ERR_BAD_TASKNAME_4"; 54 55 56 public static final String ERR_BAD_TASKNAME_EMPTY_0 = "ERR_BAD_TASKNAME_EMPTY_0"; 57 58 59 public static final String GUI_TASK_STATE_ENDED_0 = "GUI_TASK_STATE_ENDED_0"; 60 61 62 public static final String GUI_TASK_STATE_HALTED_0 = "GUI_TASK_STATE_HALTED_0"; 63 64 65 public static final String GUI_TASK_STATE_PREPARED_0 = "GUI_TASK_STATE_PREPARED_0"; 66 67 68 public static final String GUI_TASK_STATE_RUNNING_0 = "GUI_TASK_STATE_RUNNING_0"; 69 70 71 public static final String GUI_TASK_STATE_START_0 = "GUI_TASK_STATE_START_0"; 72 73 74 public static final String GUI_TASK_STATE_STARTED_0 = "GUI_TASK_STATE_STARTED_0"; 75 76 77 public static final String GUI_TASK_STATE_UNKNOWN_0 = "GUI_TASK_STATE_UNKNOWN_0"; 78 79 80 public static final String GUI_TASK_TYPE_ACTIVE_0 = "GUI_TASK_TYPE_ACTIVE_0"; 81 82 83 public static final String GUI_TASK_TYPE_ALL_0 = "GUI_TASK_TYPE_ALL_0"; 84 85 86 public static final String GUI_TASK_TYPE_DONE_0 = "GUI_TASK_TYPE_DONE_0"; 87 88 89 public static final String GUI_TASK_TYPE_ILLEGAL_0 = "GUI_TASK_TYPE_ILLEGAL_0"; 90 91 92 public static final String GUI_TASK_TYPE_NEW_0 = "GUI_TASK_TYPE_NEW_0"; 93 94 95 public static final String GUI_TASK_TYPE_OPEN_0 = "GUI_TASK_TYPE_OPEN_0"; 96 97 98 private static final String BUNDLE_NAME = "org.opencms.workflow.messages"; 99 100 101 private static final I_CmsMessageBundle INSTANCE = new Messages(); 102 103 106 private Messages() { 107 108 } 110 111 116 public static I_CmsMessageBundle get() { 117 118 return INSTANCE; 119 } 120 121 141 public static String toTaskTypeString(int taskType) { 142 143 return toTaskTypeString(taskType, CmsLocaleManager.getDefaultLocale()); 144 } 145 146 168 169 public static String toTaskTypeString(int taskType, CmsRequestContext context) { 170 171 return toTaskTypeString(taskType, context.getLocale()); 172 } 173 174 195 public static String toTaskTypeString(int taskType, Locale locale) { 196 197 switch (taskType) { 198 case CmsTaskService.TASKS_ACTIVE: 199 return Messages.get().getBundle(locale).key(Messages.GUI_TASK_TYPE_ACTIVE_0); 200 case CmsTaskService.TASKS_ALL: 201 return Messages.get().getBundle(locale).key(Messages.GUI_TASK_TYPE_ACTIVE_0); 202 case CmsTaskService.TASKS_DONE: 203 return Messages.get().getBundle(locale).key(Messages.GUI_TASK_TYPE_ACTIVE_0); 204 case CmsTaskService.TASKS_NEW: 205 return Messages.get().getBundle(locale).key(Messages.GUI_TASK_TYPE_ACTIVE_0); 206 case CmsTaskService.TASKS_OPEN: 207 default: 208 return Messages.get().getBundle(locale).key(Messages.GUI_TASK_TYPE_ILLEGAL_0); 209 } 210 } 211 212 217 public String getBundleName() { 218 219 return BUNDLE_NAME; 220 } 221 222 } | Popular Tags |