package diskfiles; import com.raghuraman.rbcore.keycontrol.msg.ints.frozen.MsgWithReloadableCacheAndOneLocale; import com.raghuraman.rbcore.keycontrol.base.BaseIntCode; public class MessagesDlMsg { /** * name of the resource bundle */ private static final String resouceBundleName = "diskfiles.Messages"; /** * The messenger field is a convenience field used by this class */ private static final MsgWithReloadableCacheAndOneLocale dlMessenger = new MsgWithReloadableCacheAndOneLocale(resouceBundleName); /** * standard example - DISK_FILES * @param diskName * @param noOfFiles * @return diskFilesMsg */ public static final String getDiskFilesMsg(String diskName, int noOfFiles) { Object[] arr = { diskName, new Integer(noOfFiles) }; return dlMessenger.getMessage(Nested.DISK_FILES, arr); } public static final String getDiskNameMsg() { return dlMessenger.getMessage(Nested.DISK_NAME); } public static final String getInstructionMsg() { return dlMessenger.getMessage(Nested.INSTRUCTION); } public static final String getSubmitMsg() { return dlMessenger.getMessage(Nested.SUBMIT); } public static final String getErrorMsg() { return dlMessenger.getMessage(Nested.ERROR); } public static final String getNoOfFilesMsg() { return dlMessenger.getMessage(Nested.NO_OF_FILES); } public static final String getSelectLocaleMsg() { return dlMessenger.getMessage(Nested.SELECT_LOCALE); } /** * All constructors are private to prevent unnecessary instantiation of this class */ private MessagesDlMsg() { } /** * Currently this method simply reloads the cache and returns true. In case reloading is not needed it * may be turned off from the general settings page of the rb editor. * @return A boolean flag to indicate whether reloading of the cache was attempted */ public static final boolean reloadDlMessengerCache() { dlMessenger.updateCache(resouceBundleName); return true; } protected static interface Nested extends BaseIntCode { public static final int DISK_FILES = Ctrl.getFirstField(Nested.class); public static final int DISK_NAME = Ctrl.getField(); public static final int INSTRUCTION = Ctrl.getField(); public static final int SUBMIT = Ctrl.getField(); public static final int ERROR = Ctrl.getField(); public static final int NO_OF_FILES = Ctrl.getField(); public static final int SELECT_LOCALE = Ctrl.getLastField(); } }