示例#1
0
  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);
    }
  }
示例#2
0
 public ConditionOperatorCBItem getConditionOperatorCBItem(ConditionOperator conditionOperator) {
   String name = Messages.getString("ML.Condition.Operator." + conditionOperator.toString());
   return new ConditionOperatorCBItem(conditionOperator, name);
 }