private void init() { this.typeOperators = new HashMap<ConditionType, ConditionOperatorCBItem[]>(); for (ConditionType ct : ConditionType.values()) { ConditionOperator[] operators = getConditionOperatorForType(ct); ConditionOperatorCBItem[] op = new ConditionOperatorCBItem[operators.length]; int i = 0; for (ConditionOperator co : operators) { try { String name; if (ct.toString().contains("_CONTAINS_")) { // use a different localization string for these conditions name = Messages.getString("ML.Condition.Operator.Contains." + co.toString()); } else { name = Messages.getString("ML.Condition.Operator." + co.toString()); } op[i++] = new ConditionOperatorCBItem(co, name); } catch (Exception ex) { log.error("Failed to initialize FolderHelper", ex); } } this.typeOperators.put(ct, op); } }
public ConditionTypeCBItem getConditionTypeCBItem(ConditionType conditionType) { String name = Messages.getString("ML.Condition.Type." + conditionType.toString()); return new ConditionTypeCBItem(conditionType, name); }