use of org.eclipse.smarthome.automation.type.Output in project smarthome by eclipse.
the class ModuleTypeResourceBundleProvider method createLocalizedActionType.
/**
* Utility method for localization of ActionTypes.
*
* @param at is an ActionType for localization.
* @param bundle the bundle providing localization resources.
* @param moduleTypeUID is an ActionType uid.
* @param locale represents a specific geographical, political, or cultural region.
* @param lconfigDescriptions are ActionType localized config descriptions.
* @param llabel is an ActionType localized label.
* @param ldescription is an ActionType localized description.
* @return localized ActionType.
*/
private ActionType createLocalizedActionType(ActionType at, Bundle bundle, String moduleTypeUID, Locale locale, List<ConfigDescriptionParameter> lconfigDescriptions, String llabel, String ldescription) {
List<Input> inputs = ModuleTypeI18nUtil.getLocalizedInputs(i18nProvider, at.getInputs(), bundle, moduleTypeUID, locale);
List<Output> outputs = ModuleTypeI18nUtil.getLocalizedOutputs(i18nProvider, at.getOutputs(), bundle, moduleTypeUID, locale);
ActionType lat = null;
if (at instanceof CompositeActionType) {
List<Action> modules = ModuleI18nUtil.getLocalizedModules(i18nProvider, ((CompositeActionType) at).getChildren(), bundle, moduleTypeUID, ModuleTypeI18nUtil.MODULE_TYPE, locale);
lat = new CompositeActionType(moduleTypeUID, lconfigDescriptions, llabel, ldescription, at.getTags(), at.getVisibility(), inputs, outputs, modules);
} else {
lat = new ActionType(moduleTypeUID, lconfigDescriptions, llabel, ldescription, at.getTags(), at.getVisibility(), inputs, outputs);
}
return lat;
}
Aggregations