Package org.w3c.dom.html

Examples of org.w3c.dom.html.HTMLDocument


    public SPITutMainDocument(ItsNatHttpServletRequest request, ItsNatHttpServletResponse response)
    {
        this.itsNatDoc = (ItsNatHTMLDocument)request.getItsNatDocument();

        HTMLDocument doc = itsNatDoc.getHTMLDocument();

        this.titleElem = (HTMLTitleElement)doc.getElementById("titleId");
        this.title = titleElem.getText(); // Initial value

        menuElemMap.put("overview",doc.getElementById("menuOpOverviewId"));
        menuElemMap.put("detail",doc.getElementById("menuOpDetailId"));
        // More menu options here...

        this.contentParentElem = doc.getElementById("contentParentId");
        this.googleAnalyticsElem = doc.getElementById("googleAnalyticsId");
        this.googleAnalyticsIFrameURL = googleAnalyticsElem.getAttribute("src")// Initial value

        if (!itsNatDoc.isCreatedByStatelessEvent())
        {
            HttpServletRequest servReq = request.getHttpServletRequest();
View Full Code Here


        super(parent.getSPITutMainDocument());
        this.parent = parent;

        SPITutMainDocument spiTutDoc = parent.getSPITutMainDocument();
        ItsNatHTMLDocument itsNatDoc = parent.getItsNatHTMLDocument();
        HTMLDocument doc = itsNatDoc.getHTMLDocument();
        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatModalLayer layer = compMgr.createItsNatModalLayer(null,false,1,0.5f,"black",null);
        Element parentLayer = layer.getElement();
        parentLayer.setAttribute("id","overviewPopupLayerContainerId");
       
        HTMLBodyElement body = (HTMLBodyElement)doc.getBody();

        DocumentFragment frag = spiTutDoc.loadDocumentFragment("overview.popup");
        Element container = ItsNatTreeWalker.getFirstChildElement(frag);
        body.appendChild(container);
View Full Code Here

{
    public SPITutStateDetail(SPITutMainDocument spiTutDoc,String stateSecondaryName)
    {
        super(spiTutDoc);
       
        HTMLDocument doc = getItsNatHTMLDocument().getHTMLDocument();           
        Element detailMoreLink = doc.getElementById("detailMoreId");       
       
        if ("moreDetail".equals(stateSecondaryName))
        {
            DocumentFragment frag = spiTutDoc.loadDocumentFragment("detail.more");
            Element detailMoreElem = ItsNatTreeWalker.getFirstChildElement(frag);       
View Full Code Here

        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();
        compMgr.addCreateItsNatComponentListener(this);

        // For "Core" examples:
        HTMLDocument doc = itsNatDoc.getHTMLDocument();
        boolean old = ((ItsNatNode)doc).isInternalMode();
        ((ItsNatNode)doc).setInternalMode(true);
        try
        {
            ((EventTarget)doc).addEventListener("DOMNodeInserted", this,false);
View Full Code Here

        elem.appendChild(link);
    }

    public HTMLAnchorElement createLink()
    {
        HTMLDocument doc = itsNatDoc.getHTMLDocument();
        HTMLAnchorElement link = (HTMLAnchorElement)doc.createElement("a");
        link.setHref("javascript:;");
        link.setAttribute("style","text-decoration:none; color:inherit;");
        return link;
    }
View Full Code Here

        load();
    }

    public void load()
    {
        HTMLDocument doc = itsNatDoc.getHTMLDocument();
        this.clickElem1 = doc.getElementById("clickableId1");
        this.clickElem2 = doc.getElementById("clickableId2");

        clickElem1.setAttribute("style","color:red;");
        Text text1 = (Text)clickElem1.getFirstChild();
        text1.setData("Click Me!");

        Text text2 = (Text)clickElem2.getFirstChild();
        text2.setData("Cannot be clicked");

        Element noteElem = doc.createElement("p");
        noteElem.appendChild(doc.createTextNode("Ready to receive clicks..."));
        doc.getBody().appendChild(noteElem);

        ((EventTarget)clickElem1).addEventListener("click",this,false);
    }
View Full Code Here

        ItsNatEvent itsNatEvt = (ItsNatEvent)evt;
        ItsNatServletRequest itsNatReq = itsNatEvt.getItsNatServletRequest();
        ItsNatDocument itsNatDoc = itsNatReq.getItsNatDocument();

        HTMLDocument doc = (HTMLDocument)itsNatDoc.getDocument();
        Element noteElem = doc.createElement("p");
        noteElem.appendChild(
                doc.createTextNode("Clicked " + ((Element)currTarget).getAttribute("id")));
        doc.getBody().appendChild(noteElem);
    }
View Full Code Here

        // Counter node with same value (state) than in client:
        String currCountStr = request.getServletRequest().getParameter("counter");
        int counter = Integer.parseInt(currCountStr);
       
        HTMLDocument doc = itsNatDoc.getHTMLDocument();
        this.counterElem = doc.getElementById("counterId");
        ((Text)counterElem.getFirstChild()).setData(String.valueOf(counter));
       
        itsNatDoc.addEventListener(this);
    }
View Full Code Here

    {
        this.itsNatDoc = itsNatDoc;
       
        // This is just an excuse to show how the initial page is a conventional ItsNat page
        // (but stateless)
        HTMLDocument doc = itsNatDoc.getHTMLDocument();
        Text node = (Text)doc.createTextNode("This the initial stateless page (not kept in server)");
        Element presentationElem = doc.getElementById("presentationId");
        presentationElem.appendChild(node);      
    }
View Full Code Here

       
        persons.add(new Person("Jhon",23));
        persons.add(new Person("Paul",60));         
        persons.add(new Person("George",65));        
       
        HTMLDocument doc = itsNatDoc.getHTMLDocument();       
       
        // TABLE based
        Element parentTBody = doc.getElementById("personListTable");         
       
        ELBasedElementList elemListTable = new ELBasedElementList("person",parentTBody,itsNatDoc,factory);
       
        for(Person person : persons)
            elemListTable.getElementList().addElement(person);         
 
        // UL based
        Element parentUL = doc.getElementById("personListUL");        

        ELBasedElementList elemListUL = new ELBasedElementList("person",parentUL,itsNatDoc,factory);       
       
        for(Person person : persons)
            elemListUL.getElementList().addElement(person);        
       
        // Input Text
       
        final Person person = new Person("Daniel",32);
       
        final Element resultsElem = doc.getElementById("resultsId");       
       
        Runnable onChanged = new Runnable()
        {
            public void run()
            {
                String name = person.getName();                 
                resultsElem.setTextContent(name);
            }
        };       
       
        HTMLInputElement inputElem = (HTMLInputElement)doc.getElementById("personNameId");       
        new ELBasedInputText("person",person,inputElem,itsNatDoc,factory,onChanged);       
    }
View Full Code Here

TOP

Related Classes of org.w3c.dom.html.HTMLDocument

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.