亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hasattributefilterwrapper.java

?? HTMLParser開源代碼附解析程序。
?? JAVA
字號:
// HTMLParser Library $Name: v1_6 $ - A java-based parser for HTML// http://sourceforge.org/projects/htmlparser// Copyright (C) 2005 Derrick Oswald//// Revision Control Information//// $Source: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/parserapplications/filterbuilder/wrappers/HasAttributeFilterWrapper.java,v $// $Author: derrickoswald $// $Date: 2005/04/12 11:27:42 $// $Revision: 1.2 $//// This library is free software; you can redistribute it and/or// modify it under the terms of the GNU Lesser General Public// License as published by the Free Software Foundation; either// version 2.1 of the License, or (at your option) any later version.//// This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU// Lesser General Public License for more details.//// You should have received a copy of the GNU Lesser General Public// License along with this library; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA//package org.htmlparser.parserapplications.filterbuilder.wrappers;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.util.HashSet;import java.util.Iterator;import java.util.Set;import java.util.Vector;import javax.swing.JCheckBox;import javax.swing.JComboBox;import javax.swing.JTextArea;import javax.swing.border.BevelBorder;import javax.swing.event.DocumentEvent;import javax.swing.event.DocumentListener;import javax.swing.text.BadLocationException;import javax.swing.text.Document;import org.htmlparser.Attribute;import org.htmlparser.Node;import org.htmlparser.NodeFilter;import org.htmlparser.Parser;import org.htmlparser.Tag;import org.htmlparser.filters.HasAttributeFilter;import org.htmlparser.parserapplications.filterbuilder.Filter;import org.htmlparser.tags.CompositeTag;import org.htmlparser.util.NodeIterator;import org.htmlparser.util.NodeList;import org.htmlparser.util.ParserException;/** * Wrapper for HasAttributeFilters. */public class HasAttributeFilterWrapper    extends        Filter    implements        ActionListener,        DocumentListener{    /**     * The underlying filter.     */    protected HasAttributeFilter mFilter;    /**     * Combo box for attribute name.     */    protected JComboBox mAttributeName;    /**     * The check box for has value.     */    protected JCheckBox mValued;    /**     * Value to check for.     */    protected JTextArea mAttributeValue;    /**     * Create a wrapper over a new HasAttributeFilter.     */     public HasAttributeFilterWrapper ()    {        String value;        mFilter = new HasAttributeFilter ();        // add the attribute name choice        mAttributeName = new JComboBox ();        mAttributeName.setEditable (true);        add (mAttributeName);        mAttributeName.addItem (mFilter.getAttributeName ());        mAttributeName.addActionListener (this);        // add the valued flag        value = mFilter.getAttributeValue ();        mValued = new JCheckBox ("Has Value");        add (mValued);        mValued.setSelected (null != value);        mValued.addActionListener (this);        // add the value pattern        mAttributeValue = new JTextArea (2, 20);        mAttributeValue.setBorder (new BevelBorder (BevelBorder.LOWERED));        add (mAttributeValue);        if (null != value)            mAttributeValue.setText (value);        else            mAttributeValue.setVisible (false);        mAttributeValue.getDocument ().addDocumentListener (this);    }    //    // local methods    //    /**     * Add the attribute names from the node to the set of attribute names.     * @param set The set to add to.     * @param node The node with attributes to add.     */    protected void addAttributes (Set set, Node node)    {        Vector attributes;        Attribute attribute;        String name;        NodeList children;        if (node instanceof Tag)        {            attributes = ((Tag)node).getAttributesEx ();            for (int i = 1; i < attributes.size (); i++)            {                attribute = (Attribute)attributes.elementAt (i);                name = attribute.getName ();                if (null != name)                    set.add (name);            }            if (node instanceof CompositeTag)            {                children = ((CompositeTag)node).getChildren ();                if (null != children)                    for (int i = 0; i < children.size (); i++)                        addAttributes (set, children.elementAt (i));            }        }    }    /**     * Add the attribute values from the node to the set of attribute values.     * @param set The set to add to.     * @param node The node with attributes to add.     */    protected void addAttributeValues (Set set, Node node)    {        Vector attributes;        Attribute attribute;        String value;        NodeList children;        if (node instanceof Tag)        {            attributes = ((Tag)node).getAttributesEx ();            for (int i = 1; i < attributes.size (); i++)            {                attribute = (Attribute)attributes.elementAt (i);                if (null != attribute.getName ())                {                    value = attribute.getValue ();                    if (null != value)                        set.add (value);                }            }            if (node instanceof CompositeTag)            {                children = ((CompositeTag)node).getChildren ();                if (null != children)                    for (int i = 0; i < children.size (); i++)                        addAttributeValues (set, children.elementAt (i));            }        }    }    //    // Filter overrides and concrete implementations    //    /**     * Get the name of the filter.     * @return A descriptive name for the filter.     */    public String getDescription ()    {        return ("Has attribute");    }    /**     * Get the resource name for the icon.     * @return The icon resource specification.     */    public String getIconSpec ()    {        return ("images/HasAttributeFilter.gif");    }    /**     * Get the underlying node filter object.     * @return The node filter object suitable for serialization.     */    public NodeFilter getNodeFilter ()    {        HasAttributeFilter ret;                ret = new HasAttributeFilter ();        ret.setAttributeName (mFilter.getAttributeName ());        ret.setAttributeValue (mFilter.getAttributeValue ());                    return (ret);    }    /**     * Assign the underlying node filter for this wrapper.     * @param filter The filter to wrap.     * @param 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 void setNodeFilter (NodeFilter filter, Parser context)    {        Set set;        String name;        String value;        mFilter = (HasAttributeFilter)filter;        set = new HashSet ();        context.reset ();        try        {            for (NodeIterator iterator = context.elements (); iterator.hasMoreNodes (); )                addAttributes (set, iterator.nextNode ());        }        catch (ParserException pe)        {            // oh well, we tried        }        for (Iterator iterator = set.iterator (); iterator.hasNext (); )            mAttributeName.addItem (iterator.next ());        name = mFilter.getAttributeName ();        if (!name.equals (""))            mAttributeName.setSelectedItem (name);        value = mFilter.getAttributeValue ();        if (null != value)        {            mValued.setSelected (true);            mAttributeValue.setVisible (true);            mAttributeValue.setText (value);        }        else        {            mValued.setSelected (false);            mAttributeValue.setVisible (false);        }    }    /**     * Get the underlying node filter's subordinate filters.     * @return The node filter object's contained filters.     */    public NodeFilter[] getSubNodeFilters ()    {        return (new NodeFilter[0]);    }    /**     * Assign the underlying node filter's subordinate filters.     * @param filters The filters to insert into the underlying node filter.     */    public void setSubNodeFilters (NodeFilter[] filters)    {        // should we complain?    }    /**     * Convert this filter into Java code.     * Output whatever text necessary and return the variable name.     * @param out The output buffer.     * @param context Three integers as follows:     * <li>indent level - the number of spaces to insert at the beginning of each line</li>     * <li>filter number - the next available filter number</li>     * <li>filter array number - the next available array of filters number</li>     * @return The variable name to use when referencing this filter (usually "filter" + context[1]++)      */    public String toJavaCode (StringBuffer out, int[] context)    {        String ret;                ret = "filter" + context[1]++;        spaces (out, context[0]);        out.append ("HasAttributeFilter ");        out.append (ret);        out.append (" = new HasAttributeFilter ();");        newline (out);        spaces (out, context[0]);        out.append (ret);        out.append (".setAttributeName (\"");        out.append (mFilter.getAttributeName ());        out.append ("\");");        newline (out);        if (null != mFilter.getAttributeValue ())        {            spaces (out, context[0]);            out.append (ret);            out.append (".setAttributeValue (\"");            out.append (mFilter.getAttributeValue ());            out.append ("\");");            newline (out);        }                return (ret);    }    //    // NodeFilter interface    //    /**     * 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.     * @return <code>true</code> if the node is to be kept, <code>false</code>     * if it is to be discarded.     * @param node The node to test.     */    public boolean accept (Node node)    {        return (mFilter.accept (node));    }    //    // ActionListener interface    //    /**     * Invoked when an action occurs on the combo box.     * @param event Details about the action event.     */    public void actionPerformed (ActionEvent event)    {        Object source;        Object[] selection;        boolean valued;        source = event.getSource ();        if (source == mAttributeName)        {            selection = mAttributeName.getSelectedObjects ();            if ((null != selection) && (0 != selection.length))                mFilter.setAttributeName ((String)selection[0]);        }        else if (source == mValued)        {            valued = mValued.isSelected ();            if (valued)            {                mFilter.setAttributeValue (mAttributeValue.getText ());                mAttributeValue.setVisible (true);            }            else            {                mAttributeValue.setVisible (false);                mAttributeValue.setText ("");                mFilter.setAttributeValue (null);            }        }    }    //    // DocumentListener interface    //    /**     * Handle an insert update event.     * @param e Details about the insert event.     */    public void insertUpdate (DocumentEvent e)    {        Document doc;                doc = e.getDocument ();        try        {            mFilter.setAttributeValue (doc.getText (0, doc.getLength ()));        }        catch (BadLocationException ble)        {            ble.printStackTrace ();        }    }    /**     * Handle a remove update event.     * @param e Details about the remove event.     */    public void removeUpdate (DocumentEvent e)    {        Document doc;                doc = e.getDocument ();        try        {            mFilter.setAttributeValue (doc.getText (0, doc.getLength ()));        }        catch (BadLocationException ble)        {            ble.printStackTrace ();        }    }    /**     * Handle a change update event.     * @param e Details about the change event.     */    public void changedUpdate (DocumentEvent e)    {        // plain text components don't fire these events    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲宅男天堂在线观看无病毒| 亚洲一区欧美一区| 不卡的看片网站| 精品国产伦理网| 亚洲精品免费在线观看| 精品一区二区在线观看| 在线中文字幕一区| 中文字幕电影一区| 狠狠网亚洲精品| 欧美一区二区大片| 色诱视频网站一区| 日韩欧美高清在线| 久久9热精品视频| 欧美理论片在线| 亚洲一区二区四区蜜桃| 色婷婷亚洲综合| 亚洲美女偷拍久久| 色综合天天综合在线视频| 国产成人亚洲精品狼色在线| 国内外成人在线视频| 91影视在线播放| 国产亚洲婷婷免费| 国产91露脸合集magnet| 成人午夜电影网站| 国产资源在线一区| 99久久er热在这里只有精品66| 国产盗摄视频一区二区三区| 亚洲国产wwwccc36天堂| 久久久久久久电影| 中文字幕在线不卡| 奇米综合一区二区三区精品视频| 紧缚奴在线一区二区三区| 色婷婷久久久综合中文字幕| 久久日韩粉嫩一区二区三区| 日本美女一区二区| 日韩欧美亚洲一区二区| 亚洲成av人片在线观看无码| 91麻豆成人久久精品二区三区| 久久久久一区二区三区四区| 奇米影视在线99精品| 欧美日韩成人综合天天影院| 亚洲免费电影在线| 欧美喷水一区二区| 水野朝阳av一区二区三区| 精品理论电影在线观看| 国产精品全国免费观看高清| 亚洲免费av高清| 日韩中文字幕亚洲一区二区va在线 | 91麻豆产精品久久久久久| 国产精品日日摸夜夜摸av| 五月婷婷激情综合网| 青青草国产成人av片免费| 国产女人18水真多18精品一级做| 最新日韩在线视频| 91视频.com| 水野朝阳av一区二区三区| 91老师片黄在线观看| 中文字幕一区不卡| 91丨九色porny丨蝌蚪| 亚洲乱码国产乱码精品精可以看| 色婷婷久久久亚洲一区二区三区 | 亚洲欧美日韩一区二区 | 麻豆精品一区二区三区| 久久久777精品电影网影网| 91视频www| 国产自产高清不卡| 午夜精品福利一区二区三区av| 日韩亚洲欧美在线| 99热精品国产| 国产在线精品一区二区不卡了 | 99久久婷婷国产| 日韩精品一二三区| 亚洲日本韩国一区| 久久精品亚洲一区二区三区浴池| 色吧成人激情小说| 国产99久久久国产精品免费看| 日韩电影在线观看网站| 亚洲美腿欧美偷拍| 中文字幕免费观看一区| 欧美一区二区三区免费观看视频| www.亚洲色图| zzijzzij亚洲日本少妇熟睡| 国产乱码一区二区三区| 五月天激情综合| 日韩精品免费视频人成| 亚洲第一搞黄网站| 日韩成人一级片| 免费久久精品视频| 精品一区二区三区的国产在线播放| 午夜精品影院在线观看| 日韩精品一二三四| 久久99热这里只有精品| 国产精品亚洲人在线观看| 大桥未久av一区二区三区中文| 国产伦精品一区二区三区在线观看| 国产在线精品免费av| 国产91精品免费| 欧美亚一区二区| 欧美一卡2卡3卡4卡| 久久久久久影视| 亚洲欧美区自拍先锋| 日本成人在线电影网| 国产精品一区二区果冻传媒| 99在线精品视频| 欧美人动与zoxxxx乱| 国产日韩欧美一区二区三区综合| 欧美经典三级视频一区二区三区| 国产精品嫩草99a| 视频一区二区中文字幕| 成人免费毛片a| 在线播放91灌醉迷j高跟美女 | 欧美久久一二三四区| 久久综合色8888| 一区二区三区蜜桃| 国产成人在线视频免费播放| 欧美日韩免费视频| 亚洲人成精品久久久久久| 奇米精品一区二区三区四区| 色又黄又爽网站www久久| 日韩一级片在线播放| 日精品一区二区三区| 国产日韩欧美激情| 亚洲免费资源在线播放| 国产曰批免费观看久久久| 欧美日韩久久一区| 亚洲欧美区自拍先锋| 91视频在线看| 国产精品毛片久久久久久久| 国产精品一区一区三区| 久久网站热最新地址| 美腿丝袜亚洲综合| 精品国产精品一区二区夜夜嗨| 香蕉成人伊视频在线观看| 欧美日韩国产大片| 日本一不卡视频| 久久美女艺术照精彩视频福利播放| 蜜桃视频一区二区| 久久精品欧美一区二区三区不卡| 国产乱码字幕精品高清av | 一二三区精品福利视频| 在线欧美日韩精品| 亚洲高清免费观看| 亚洲精品在线免费观看视频| 国产乱码一区二区三区| 1024亚洲合集| 91精品国产色综合久久| 国产精品一级二级三级| 亚洲日本在线天堂| 日韩一卡二卡三卡四卡| 风间由美一区二区三区在线观看 | 国产精品久久久久天堂| 欧洲中文字幕精品| 国产精品综合一区二区| 亚洲视频一区二区免费在线观看| 欧美剧在线免费观看网站| 成人一区二区三区在线观看| 亚洲一区二区三区四区五区黄| 日韩一区二区三区视频在线 | 国产精品嫩草影院av蜜臀| 91精品午夜视频| 91高清在线观看| 91在线观看视频| 国产精品99久久久久久久女警| 夜夜精品视频一区二区| 国产精品二区一区二区aⅴ污介绍| 欧美日韩国产不卡| 欧洲av在线精品| 色又黄又爽网站www久久| av高清不卡在线| 成人午夜免费电影| 成人免费视频一区| 久久激情五月婷婷| 日本亚洲天堂网| 三级欧美韩日大片在线看| 亚洲免费观看在线视频| 一区二区三区中文字幕精品精品 | 欧美老人xxxx18| 日韩午夜在线播放| 久久亚洲影视婷婷| 日韩免费观看高清完整版在线观看| 欧美美女一区二区在线观看| 欧美日韩一级二级| 欧美大度的电影原声| 精品日产卡一卡二卡麻豆| 欧美成va人片在线观看| 久久亚洲私人国产精品va媚药| 欧美videos大乳护士334| 久久久亚洲欧洲日产国码αv| 久久一区二区三区国产精品| 国产欧美综合在线观看第十页| 欧美国产亚洲另类动漫| 亚洲美女偷拍久久| 国产综合色产在线精品| 成人av电影观看| 3atv一区二区三区| 国产精品萝li| 精品一区二区免费在线观看| av在线综合网| 日韩一区二区高清| 亚洲欧美电影院|