Ejemplo n.º 1
0
  /**
   * Test the value. This is called only if the pre-check returned true, because accessing the value
   * might be potentially costly
   *
   * @param renderer
   * @param adapter
   * @return
   */
  private boolean test(Component renderer, ComponentAdapter adapter) {
    if (!adapter.isTestable(testColumn)) return false;
    String value = adapter.getString(testColumn);

    if ((value == null) || (value.length() == 0)) {
      return false;
    }
    return pattern.matcher(value).find();
    // this is pre-767-swingx: consistent string api
    //        Object value = adapter.getValue(testColumn);
    //
    //        if (value == null) {
    //            return false;
    //        } else {
    //            return pattern.matcher(value.toString()).find();
    //        }
  }