public boolean isNumeric(DTColumnConfig col, SuggestionCompletionEngine sce) {
   if (col instanceof AttributeCol) {
     AttributeCol at = (AttributeCol) col;
     return "salience".equals(at.getAttribute()) || "duration".equals(at.getAttribute());
   } else {
     return isDataType(col, sce, SuggestionCompletionEngine.TYPE_NUMERIC);
   }
 }
 public boolean isDate(DTColumnConfig col, SuggestionCompletionEngine sce) {
   if (col instanceof AttributeCol) {
     AttributeCol at = (AttributeCol) col;
     return "date-effective".equals(at.getAttribute()) || "date-expires".equals(at.getAttribute());
   } else {
     return isDataType(col, sce, SuggestionCompletionEngine.TYPE_DATE);
   }
 }
 public boolean isBoolean(DTColumnConfig col, SuggestionCompletionEngine sce) {
   if (col instanceof AttributeCol) {
     AttributeCol at = (AttributeCol) col;
     return "enabled".equals(at.getAttribute())
         || "no-loop".equals(at.getAttribute())
         || "auto-focus".equals(at.getAttribute())
         || "lock-on-active".equals(at.getAttribute());
   } else {
     return isDataType(col, sce, SuggestionCompletionEngine.TYPE_BOOLEAN);
   }
 }
  public String getType(DTColumnConfig col, SuggestionCompletionEngine sce) {
    String type = null;
    if (col instanceof AttributeCol) {
      AttributeCol at = (AttributeCol) col;
      type = at.getAttribute();
    } else if (col instanceof ConditionCol) {
      ConditionCol c = (ConditionCol) col;
      type = sce.getFieldType(c.getFactType(), c.getFactField());
    } else if (col instanceof ActionSetFieldCol) {
      ActionSetFieldCol c = (ActionSetFieldCol) col;
      type = sce.getFieldType(getBoundFactType(c.getBoundName()), c.getFactField());
    } else if (col instanceof ActionInsertFactCol) {
      ActionInsertFactCol c = (ActionInsertFactCol) col;
      type = sce.getFieldType(c.getFactType(), c.getFactField());
    }

    return type;
  }
  /**
   * This will return a list of valid values. if there is no such "enumeration" of values, then it
   * will return an empty array.
   */
  public String[] getValueList(DTColumnConfig col, SuggestionCompletionEngine sce) {
    if (col instanceof AttributeCol) {
      AttributeCol at = (AttributeCol) col;
      if ("no-loop".equals(at.getAttribute()) || "enabled".equals(at.getAttribute())) {
        return new String[] {"true", "false"};
      }
    } else if (col instanceof ConditionCol) {
      // conditions: if its a formula etc, just return String[0],
      // otherwise check with the sce
      ConditionCol c = (ConditionCol) col;
      if (c.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_RET_VALUE
          || c.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_PREDICATE) {
        return new String[0];
      } else {
        if (c.getValueList() != null && !"".equals(c.getValueList())) {
          return c.getValueList().split(",");
        } else {
          String[] r = sce.getEnumValues(c.getFactType(), c.getFactField());
          return (r != null) ? r : new String[0];
        }
      }
    } else if (col instanceof ActionSetFieldCol) {
      ActionSetFieldCol c = (ActionSetFieldCol) col;
      if (c.getValueList() != null && !"".equals(c.getValueList())) {
        return c.getValueList().split(",");
      } else {
        String[] r = sce.getEnumValues(getBoundFactType(c.getBoundName()), c.getFactField());
        return (r != null) ? r : new String[0];
      }
    } else if (col instanceof ActionInsertFactCol) {
      ActionInsertFactCol c = (ActionInsertFactCol) col;
      if (c.getValueList() != null && !"".equals(c.getValueList())) {
        return c.getValueList().split(",");
      } else {
        String[] r = sce.getEnumValues(c.getFactType(), c.getFactField());
        return (r != null) ? r : new String[0];
      }
    }

    return new String[0];
  }