/**
   * Invoked when an action occurs on the check box.
   *
   * @param event Details about the action event.
   */
  public void actionPerformed(ActionEvent event) {
    Object source;
    boolean recursive;

    source = event.getSource();
    if (source == mRecursive) {
      recursive = mRecursive.isSelected();
      mFilter.setRecursive(recursive);
    }
  }
  /**
   * Get the underlying node filter object.
   *
   * @return The node filter object suitable for serialization.
   */
  public NodeFilter getNodeFilter() {
    NodeFilter filter;
    HasChildFilter ret;

    ret = new HasChildFilter();

    ret.setRecursive(mFilter.getRecursive());
    filter = mFilter.getChildFilter();
    if (null != filter) ret.setChildFilter(((Filter) filter).getNodeFilter());

    return (ret);
  }
Example #3
0
 /**
  * Creates a new instance of HasChildFilter that accepts nodes with a child acceptable to the
  * filter. Of necessity, this applies only to composite tags, i.e. those that can contain other
  * nodes, for example <HTML></HTML>.
  *
  * @param filter The filter to apply to children.
  * @param recursive If <code>true</code>, any enclosed node acceptable to the given filter causes
  *     the node being tested to be accepted (i.e. a recursive scan through the child nodes down
  *     the node heirarchy is performed).
  */
 public HasChildFilter(NodeFilter filter, boolean recursive) {
   setChildFilter(filter);
   setRecursive(recursive);
 }