1 19 20 package org.netbeans.modules.editor; 21 22 import java.util.MissingResourceException ; 23 import org.openide.util.NbBundle; 24 import org.netbeans.editor.LocaleSupport; 25 26 33 34 public class NbLocalizer implements LocaleSupport.Localizer { 35 private Class bundleClass; 38 39 42 public NbLocalizer(Class bundleClass) { 43 this.bundleClass = bundleClass; 44 } 45 46 47 public String getString(String key) { 48 try { 49 return NbBundle.getBundle(bundleClass).getString(key); 50 } catch (MissingResourceException e) { 51 return null; 52 } 53 } 54 55 public String toString() { 56 return "NbLocalizer(" + bundleClass + ")"; } 58 59 } 60 | Popular Tags |