HTML Parser Home Page

Class HasParentFilterWrapper

  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by org.htmlparser.parserapplications.filterbuilder.Filter
                  extended by org.htmlparser.parserapplications.filterbuilder.wrappers.HasParentFilterWrapper
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, Cloneable, EventListener, NodeFilter

public class HasParentFilterWrapper
extends Filter
implements ActionListener

Wrapper for HasParentFilters.

See Also:
Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
Nested classes/interfaces inherited from class java.awt.Container
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
Field Summary
protected  SubFilterList mContainer
          The drop target container.
protected  HasParentFilter mFilter
          The underlying filter.
protected  JCheckBox mRecursive
          The check box for recursion.
Fields inherited from class org.htmlparser.parserapplications.filterbuilder.Filter
Fields inherited from class javax.swing.JComponent
Fields inherited from class java.awt.Component
Fields inherited from interface java.awt.image.ImageObserver
Constructor Summary
          Create a wrapper over a new HasParentFilter.
Method Summary
 boolean accept(Node node)
          Predicate to determine whether or not to keep the given node.
 void actionPerformed(ActionEvent event)
          Invoked when an action occurs on the check box.
 String getDescription()
          Get the name of the filter.
 String getIconSpec()
          Get the resource name for the icon.
 NodeFilter getNodeFilter()
          Get the underlying node filter object.
 NodeFilter[] getSubNodeFilters()
          Get the underlying node filter's subordinate filters.
 void setNodeFilter(NodeFilter filter, Parser context)
          Assign the underlying node filter for this wrapper.
 void setSubNodeFilters(NodeFilter[] filters)
          Assign the underlying node filter's subordinate filters.
 String toJavaCode(StringBuffer out, int[] context)
          Convert this filter into Java code.
Methods inherited from class org.htmlparser.parserapplications.filterbuilder.Filter
deconstitute, deserialize, getEnclosed, getIcon, instantiate, newline, pickle, reconstitute, serialize, setExpanded, setSelected, spaces, toString, unpickle, wrap
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


protected HasParentFilter mFilter
The underlying filter.


protected JCheckBox mRecursive
The check box for recursion.


protected SubFilterList mContainer
The drop target container.

Constructor Detail


public HasParentFilterWrapper()
Create a wrapper over a new HasParentFilter.

Method Detail


public String getDescription()
Get the name of the filter.

Specified by:
getDescription in class Filter
A descriptive name for the filter.


public String getIconSpec()
Get the resource name for the icon.

Specified by:
getIconSpec in class Filter
The icon resource specification.


public NodeFilter getNodeFilter()
Get the underlying node filter object.

Specified by:
getNodeFilter in class Filter
The node filter object suitable for serialization.


public void setNodeFilter(NodeFilter filter,
                          Parser context)
Assign the underlying node filter for this wrapper.

Specified by:
setNodeFilter in class Filter
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.


public NodeFilter[] getSubNodeFilters()
Get the underlying node filter's subordinate filters.

Specified by:
getSubNodeFilters in class Filter
The node filter object's contained filters.


public void setSubNodeFilters(NodeFilter[] filters)
Assign the underlying node filter's subordinate filters.

Specified by:
setSubNodeFilters in class Filter
filters - The filters to insert into the underlying node filter.


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
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]++)


    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
    node - The node to test.
    true if the node is to be kept, false if it is to be discarded.


    public void actionPerformed(ActionEvent event)
    Invoked when an action occurs on the check box.

    Specified by:
    actionPerformed in interface ActionListener
    event - Details about the action event.

    © 2006 Derrick Oswald
    Sep 17, 2006

    HTML Parser is an open source library released under Common Public License.