Search in sources :

Example 11 with Output

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;
}
Also used : Input(org.eclipse.smarthome.automation.type.Input) Action(org.eclipse.smarthome.automation.Action) CompositeActionType(org.eclipse.smarthome.automation.type.CompositeActionType) ActionType(org.eclipse.smarthome.automation.type.ActionType) Output(org.eclipse.smarthome.automation.type.Output) CompositeActionType(org.eclipse.smarthome.automation.type.CompositeActionType)

Aggregations

Output (org.eclipse.smarthome.automation.type.Output)11 ArrayList (java.util.ArrayList)5 HashMap (java.util.HashMap)3 LinkedHashMap (java.util.LinkedHashMap)3 StringTokenizer (java.util.StringTokenizer)2 Action (org.eclipse.smarthome.automation.Action)2 ActionType (org.eclipse.smarthome.automation.type.ActionType)2 Input (org.eclipse.smarthome.automation.type.Input)2 TriggerType (org.eclipse.smarthome.automation.type.TriggerType)2 Trigger (org.eclipse.smarthome.automation.Trigger)1 ActionHandler (org.eclipse.smarthome.automation.handler.ActionHandler)1 CompositeActionType (org.eclipse.smarthome.automation.type.CompositeActionType)1 CompositeTriggerType (org.eclipse.smarthome.automation.type.CompositeTriggerType)1