Class HasChildFilterWrapper

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, Cloneable, EventListener, NodeFilter

public class HasChildFilterWrapper extends Filter implements ActionListener
Wrapper for HasChildFilters.
See Also:
  • Field Details

    • mFilter

      protected HasChildFilter mFilter
      The underlying filter.
    • mRecursive

      protected JCheckBox mRecursive
      The check box for recursion.
    • mContainer

      protected SubFilterList mContainer
      The drop target container.
  • Constructor Details

    • HasChildFilterWrapper

      public HasChildFilterWrapper()
      Create a wrapper over a new HasChildFilter.
  • Method Details

    • getDescription

      public String getDescription()
      Get the name of the filter.
      Specified by:
      getDescription in class Filter
      Returns:
      A descriptive name for the filter.
    • getIconSpec

      public String getIconSpec()
      Get the resource name for the icon.
      Specified by:
      getIconSpec in class Filter
      Returns:
      The icon resource specification.
    • getNodeFilter

      public NodeFilter getNodeFilter()
      Get the underlying node filter object.
      Specified by:
      getNodeFilter in class Filter
      Returns:
      The node filter object suitable for serialization.
    • setNodeFilter

      public void setNodeFilter(NodeFilter filter, Parser context)
      Assign the underlying node filter for this wrapper.
      Specified by:
      setNodeFilter in class Filter
      Parameters:
      filter - The filter to wrap.
      context - The parser to use for conditioning this filter. Some filters need contextual information to provide to the user, i.e. for tag names or attribute names or values, so the Parser context is provided.
    • getSubNodeFilters

      public NodeFilter[] getSubNodeFilters()
      Get the underlying node filter's subordinate filters.
      Specified by:
      getSubNodeFilters in class Filter
      Returns:
      The node filter object's contained filters.
    • setSubNodeFilters

      public void setSubNodeFilters(NodeFilter[] filters)
      Assign the underlying node filter's subordinate filters.
      Specified by:
      setSubNodeFilters in class Filter
      Parameters:
      filters - The filters to insert into the underlying node filter.
    • toJavaCode

      public String toJavaCode(StringBuffer out, int[] context)
      Convert this filter into Java code. Output whatever text necessary and return the variable name.
      Specified by:
      toJavaCode in class Filter
      Parameters:
      out - The output buffer.
      context - Three integers as follows:
    • indent level - the number of spaces to insert at the beginning of each line
    • filter number - the next available filter number
    • filter array number - the next available array of filters number
    • Returns:
      The variable name to use when referencing this filter (usually "filter" + context[1]++)
    • accept

      public boolean accept(Node node)
      Predicate to determine whether or not to keep the given node. The behaviour based on this outcome is determined by the context in which it is called. It may lead to the node being added to a list or printed out. See the calling routine for details.
      Specified by:
      accept in interface NodeFilter
      Parameters:
      node - The node to test.
      Returns:
      true if the node is to be kept, false if it is to be discarded.
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Invoked when an action occurs on the check box.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      event - Details about the action event.