本文整理匯總了Java中org.eclipse.e4.core.services.translation.TranslationService類的典型用法代碼示例。如果您正苦於以下問題:Java TranslationService類的具體用法?Java TranslationService怎麽用?Java TranslationService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TranslationService類屬於org.eclipse.e4.core.services.translation包,在下文中一共展示了TranslationService類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initialize
import org.eclipse.e4.core.services.translation.TranslationService; //導入依賴的package包/類
public static void initialize(IEclipseContext applicationContext){
apContext = applicationContext;
//bug fix...
apContext.set(TranslationService.LOCALE, "en");
csContext.setParent(apContext);
}
示例2: setResourceBundle
import org.eclipse.e4.core.services.translation.TranslationService; //導入依賴的package包/類
@Inject
void setResourceBundle(ResourceBundleProvider provider, @Named(TranslationService.LOCALE) Locale locale) {
Bundle bundle = FrameworkUtil.getBundle(this.getClass());
this.resourceBundle = provider.getResourceBundle(bundle, locale.toString());
}
示例3: getNotifiedByInjection
import org.eclipse.e4.core.services.translation.TranslationService; //導入依賴的package包/類
@Inject
@Optional
private void getNotifiedByInjection(@Named(TranslationService.LOCALE) Locale s) {
System.out.println("Injected via context: " + s);
}
示例4: execute
import org.eclipse.e4.core.services.translation.TranslationService; //導入依賴的package包/類
@Execute
public void execute(ILocaleChangeService lcs, @Named(TranslationService.LOCALE) Locale locale) {
Locale input = (locale != null && locale.equals(Locale.GERMAN)) ? Locale.ENGLISH : Locale.GERMAN;
lcs.changeApplicationLocale(input);
}