Package org.htmlparser.tags

Examples of org.htmlparser.tags.AppletTag


                // look for applets

                // This will only work with an Applet .class file.
                // Ideally, this should be upgraded to work with Objects (IE)
                // and archives (.jar and .zip) files as well.
                AppletTag applet = (AppletTag) tag;
                binUrlStr = applet.getAppletClass();
            } else if (tag instanceof InputTag) {
                // we check the input tag type for image
                if (ATT_IS_IMAGE.equalsIgnoreCase(tag.getAttribute(ATT_TYPE))) {
                    // then we need to download the binary
                    binUrlStr = tag.getAttribute(ATT_SRC);
View Full Code Here


            // look for applets

            // This will only work with an Applet .class file.
            // Ideally, this should be upgraded to work with Objects (IE)
            // and archives (.jar and .zip) files as well.
                AppletTag applet = (AppletTag) tag;
                binUrlStr = applet.getAppletClass();
            } else if (tag instanceof InputTag) {
                // we check the input tag type for image
                if (ATT_IS_IMAGE.equalsIgnoreCase(tag.getAttribute(ATT_TYPE))) {
                    // then we need to download the binary
                    binUrlStr = tag.getAttribute(ATT_SRC);
View Full Code Here

                // look for applets

                // This will only work with an Applet .class file.
                // Ideally, this should be upgraded to work with Objects (IE)
                // and archives (.jar and .zip) files as well.
                AppletTag applet = (AppletTag) tag;
                binUrlStr = applet.getAppletClass();
            } else if (tag instanceof ObjectTag) {
                // look for Objects
                ObjectTag applet = (ObjectTag) tag;
                String data = applet.getAttribute(ATT_CODEBASE);
                if(!StringUtils.isEmpty(data)) {
                    binUrlStr = data;              
                }
               
                data = applet.getAttribute(ATT_DATA);
                if(!StringUtils.isEmpty(data)) {
                    binUrlStr = data;                   
                }
               
            } else if (tag instanceof InputTag) {
View Full Code Here

     * calling {@link #registerTag(Tag) registerTag()}.
     * @return 'this' nodefactory as a convenience.
     */
    public PrototypicalNodeFactory registerTags ()
    {
        registerTag (new AppletTag ());
        registerTag (new BaseHrefTag ());
        registerTag (new Bullet ());
        registerTag (new BulletList ());
        registerTag (new DefinitionList ());
        registerTag (new DefinitionListBullet ());
View Full Code Here

            "</HTML>";
        createParser(testHTML);
        parseAndAssertNodeCount(3);
        assertTrue("Node should be an applet tag",node[0] instanceof AppletTag);
        // Check the data in the applet tag
        AppletTag appletTag = (AppletTag)node[0];
        String expectedRawString =
        "<APPLET CODE=Myclass.class ARCHIVE=test.jar CODEBASE=www.kizna.com>\n"+
        "<PARAM NAME=\"Param1\" VALUE=\"Value1\">\n"+
        "<PARAM NAME=\"Name\" VALUE=\"Somik\">\n"+
        "<PARAM NAME=\"Age\" VALUE=\"23\">\n"+
        "</APPLET>";
        assertStringEquals("toHTML()",expectedRawString,appletTag.toHtml());
    }
View Full Code Here

            "</APPLET></HTML>";
        createParser(testHTML);
        parseAndAssertNodeCount(2);
        assertTrue("Node should be an applet tag",node[0] instanceof AppletTag);
        // Check the data in the applet tag
        AppletTag appletTag = (AppletTag)node[0];
        assertEquals("Class Name","Myclass.class",appletTag.getAppletClass());
        assertEquals("Archive","test.jar",appletTag.getArchive());
        assertEquals("Codebase","www.kizna.com",appletTag.getCodeBase());
        // Check the params data
        int cnt = 0;
        for (Enumeration e = appletTag.getParameterNames();e.hasMoreElements();)
        {
            String paramName = (String)e.nextElement();
            String paramValue = appletTag.getParameter(paramName);
            assertEquals("Param "+cnt+" value",paramsMap.get(paramName),paramValue);
            cnt++;
        }
        assertEquals("Number of params",new Integer(paramsData.length),new Integer(cnt));
    }
View Full Code Here

            "</APPLET>\n"+
            "</HTML>";
        createParser(testHTML);
        parseAndAssertNodeCount(3);
        assertTrue("Node should be an applet tag",node[0] instanceof AppletTag);
        AppletTag appletTag = (AppletTag)node[0];
        appletTag.setCodeBase ("htmlparser.sourceforge.net");
        // Check the data in the applet tag
        String expectedRawString =
        "<APPLET CODE=Myclass.class ARCHIVE=test.jar CODEBASE=htmlparser.sourceforge.net>\n"+
        "<PARAM NAME=\"Param1\" VALUE=\"Value1\">\n"+
        "<PARAM NAME=\"Name\" VALUE=\"Somik\">\n"+
        "<PARAM NAME=\"Age\" VALUE=\"23\">\n"+
        "</APPLET>";
        assertStringEquals("toHTML()",expectedRawString,appletTag.toHtml());
    }
View Full Code Here

        testHTML +=
            "</APPLET>";
        createParser(testHTML + "\n</HTML>");
        parseAndAssertNodeCount(3);
        assertTrue("Node should be an applet tag",node[0] instanceof AppletTag);
        AppletTag appletTag = (AppletTag)node[0];
        appletTag.setArchive ("htmlparser.jar");
        // Check the data in the applet tag
        testHTML = testHTML.substring (0, testHTML.indexOf ("test.jar"))
            + "htmlparser.jar"
            + testHTML.substring (testHTML.indexOf ("test.jar") + 8);
        assertStringEquals("toHTML()",testHTML,appletTag.toHtml());
    }
View Full Code Here

        testHTML+=
            "</APPLET>";
        createParser(testHTML + "\n</HTML>");
        parseAndAssertNodeCount(3);
        assertTrue("Node should be an applet tag",node[0] instanceof AppletTag);
        AppletTag appletTag = (AppletTag)node[0];
        appletTag.setAppletClass ("MyOtherClass.class");
        // Check the data in the applet tag
        testHTML = testHTML.substring (0, testHTML.indexOf ("Myclass.class"))
            + "MyOtherClass.class"
            + testHTML.substring (testHTML.indexOf ("Myclass.class") + 13);
        assertStringEquals("toHTML()",testHTML,appletTag.toHtml());
    }
View Full Code Here

            "</APPLET>\n"+
            "</HTML>";
        createParser(testHTML);
        parseAndAssertNodeCount(3);
        assertTrue("Node should be an applet tag",node[0] instanceof AppletTag);
        AppletTag appletTag = (AppletTag)node[0];
        paramsMap = new Hashtable();
        String [][] newparamsData = {{"First","One"},{"Second","Two"},{"Third","3"}};
        for (int i = 0;i<paramsData.length;i++)
        {
            paramsMap.put(newparamsData[i][0],newparamsData[i][1]);
        }
        appletTag.setAppletParams (paramsMap);
        // Check the data in the applet tag
        String expectedRawString =
        "<APPLET CODE=Myclass.class ARCHIVE=test.jar CODEBASE=www.kizna.com>\n"+
        "<PARAM VALUE=\"Two\" NAME=\"Second\">"+ // note these are out of orer because of the hashtable
        "<PARAM VALUE=\"One\" NAME=\"First\">"+
        "<PARAM VALUE=\"3\" NAME=\"Third\">"+
        "</APPLET>";
        String actual = appletTag.toHtml();
        assertStringEquals("toHTML()",expectedRawString,actual);
    }
View Full Code Here

TOP

Related Classes of org.htmlparser.tags.AppletTag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.