1 4 package com.tc.admin; 5 6 import org.dijon.DictionaryResource; 7 8 import com.tc.util.ResourceBundleHelper; 9 10 import java.util.prefs.Preferences ; 11 12 import javax.swing.UIDefaults ; 13 14 public class AdminClientContext { 15 public AdminClient client; 16 public AdminClientController controller; 17 public UIDefaults uiDefaults; 18 public ResourceBundleHelper bundleHelper; 19 public DictionaryResource topRes; 20 public Preferences prefs; 21 22 25 public String getMessage(String id) { 26 return getString(id); 27 } 28 29 32 public String getString(String id) { 33 return bundleHelper.getString(id); 34 } 35 36 public String format(final String key, Object [] args) { 37 return bundleHelper.format(key, args); 38 } 39 40 43 public String [] getMessages(String [] ids) { 44 String [] result = null; 45 46 if(ids != null && ids.length > 0) { 47 int count = ids.length; 48 49 result = new String [count]; 50 51 for(int i = 0; i < count; i++) { 52 result[i] = getMessage(ids[i]); 53 } 54 } 55 56 return result; 57 } 58 59 60 63 public Object getObject(String id) { 64 return bundleHelper.getObject(id); 65 } 66 67 70 public void log(String msg) { 71 controller.log(msg); 72 } 73 74 77 public void log(Exception e) { 78 controller.log(e); 79 } 80 81 84 public void setStatus(String msg) { 85 controller.setStatus(msg); 86 } 87 } 88 | Popular Tags |