public abstract class Filter extends javax.swing.JComponent implements NodeFilter
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
构造器和说明 |
---|
Filter()
Create a filter.
|
限定符和类型 | 方法和说明 |
---|---|
static java.lang.String |
deconstitute(Filter[] filters)
Returns a string serialization of the filters.
|
static byte[] |
deserialize(java.lang.String string)
Convert a sequence of hexadecimal characters back into a byte array.
|
abstract java.lang.String |
getDescription()
Get the name of the filter.
|
javax.swing.Icon |
getIcon()
Get the icon for the filter.
|
abstract java.lang.String |
getIconSpec()
Get the resource name for the icon.
|
abstract NodeFilter |
getNodeFilter()
Get the underlying node filter object.
|
abstract NodeFilter[] |
getSubNodeFilters()
Get the underlying node filter's subordinate filters.
|
static Filter |
instantiate(java.lang.String class_name)
Create a new filter from the class name.
|
static void |
newline(java.lang.StringBuffer out)
Append a newline to the buffer.
|
static byte[] |
pickle(java.lang.Object object)
Serialize an object to a byte array.
|
static Filter[] |
reconstitute(java.lang.String string,
Parser context)
Returns the filters represented by the string.
|
static java.lang.String |
serialize(byte[] data)
Serialize a byte array to a String.
|
void |
setExpanded(boolean expanded)
Set the expanded state for the component.
|
abstract void |
setNodeFilter(NodeFilter filter,
Parser context)
Assign the underlying node filter for this wrapper.
|
void |
setSelected(boolean selected)
Set the 'selected look' for the component.
|
abstract void |
setSubNodeFilters(NodeFilter[] filters)
Assign the underlying node filter's subordinate filters.
|
static void |
spaces(java.lang.StringBuffer out,
int count)
Append count spaces to the buffer.
|
abstract java.lang.String |
toJavaCode(java.lang.StringBuffer out,
int[] context)
Convert this filter into Java code.
|
java.lang.String |
toString()
Returns a string representation of this component and its values.
|
static java.lang.Object |
unpickle(byte[] data)
Reconstitute a serialized object.
|
static Filter |
wrap(NodeFilter filter,
Parser context)
Returns a wrapped filter.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, 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, 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, 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, transferFocusBackward, transferFocusUpCycle
accept
public Filter()
getDescription()
,
and an icon, returned by getIcon()
.public static Filter instantiate(java.lang.String class_name)
class_name
- The class to instatiate.public abstract java.lang.String getDescription()
public abstract NodeFilter getNodeFilter()
public abstract void setNodeFilter(NodeFilter filter, Parser context)
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 abstract NodeFilter[] getSubNodeFilters()
public abstract void setSubNodeFilters(NodeFilter[] filters)
filters
- The filters to insert into the underlying node filter.public abstract java.lang.String toJavaCode(java.lang.StringBuffer out, int[] context)
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 numberpublic javax.swing.Icon getIcon()
getIconSpec()
as an icon.public abstract java.lang.String getIconSpec()
public java.lang.String toString()
toString
在类中 java.awt.Component
public static byte[] pickle(java.lang.Object object) throws java.io.IOException
object
- The object to be pickled.java.io.IOException
- If the output stream complains (unlikely).public static java.lang.Object unpickle(byte[] data) throws java.io.IOException, java.lang.ClassNotFoundException
data
- The pickled object.java.io.IOException
- If the input stream complains.java.lang.ClassNotFoundException
- If the serialized object class cannot
be located.public static java.lang.String serialize(byte[] data)
data
- The serialized object as a byte array.public static byte[] deserialize(java.lang.String string)
string
- The string to convert (must be correct hex characters).public static java.lang.String deconstitute(Filter[] filters) throws java.io.IOException
filters
- The list of filters to serialize.java.io.IOException
- If serialization fails.public static Filter[] reconstitute(java.lang.String string, Parser context)
string
- The string with serialized node filters.context
- The context from which to extract meaningful values
for GUI choices (which aren't serialized).wrap(org.htmlparser.NodeFilter, org.htmlparser.Parser)
public static Filter wrap(NodeFilter filter, Parser context)
filter
- A filter to be wrapped by GUI components.context
- The context within which to wrap the object.
Some wrappers need context to set up useful choices for the user.public void setSelected(boolean selected)
selected
- If true
, 'select' this component,
otherwise 'deselect' it.public void setExpanded(boolean expanded)
expanded
- If true
, 'expand' this component,
otherwise 'collapse' it.public static void spaces(java.lang.StringBuffer out, int count)
out
- The buffer to append to.count
- The number of spaces to append.public static void newline(java.lang.StringBuffer out)
out
- The buffer to append to.