Package org.itsnat.core.event

Examples of org.itsnat.core.event.ItsNatUserEvent


    public void handleEvent(Event evt)
    {
        if (evt instanceof ItsNatUserEvent)
        {
            ItsNatUserEvent itsNatEvt = (ItsNatUserEvent)evt;
            String name = (String)itsNatEvt.getExtraParam("name");
            changeState(name);
        }
    }
View Full Code Here


        this.linkToStart = null;
    }

    public void handleEvent(Event evt)
    {
        ItsNatUserEvent userEvt = (ItsNatUserEvent)evt;
        String title = (String)userEvt.getExtraParam("title");
        log("Page title: " + title);
        String url = (String)userEvt.getExtraParam("url");
        log("URL: " + url);
        Object[] both = userEvt.getExtraParamMultiple("both");
        log("Page title/URL: " + both[0] + "/" + both[1]);       
    }
View Full Code Here

        EventListener listener = new EventListener()
        {
            public void handleEvent(Event evt)
            {
                ItsNatUserEvent userEvt = (ItsNatUserEvent)evt;
                String title = (String)userEvt.getExtraParam("title");
                System.out.println("Page title: " + title);
                String url = (String)userEvt.getExtraParam("url");
                System.out.println("URL: " + url);
                Object[] both = userEvt. getExtraParamMultiple("both");
                System.out.println("Page title/URL: " + both[0] + "/" + both[1]);
            }
        };

        itsNatDoc.addUserEventListener((EventTarget)buttonElem,"myUserAction",listener);
View Full Code Here

                            // Alternatives:
                            // itsNatDoc.dispatchEvent((EventTarget)buttonElem,mouseEvt);
                            // clientDoc.dispatchEvent((EventTarget)buttonElem,mouseEvt);
                        }

                        ItsNatUserEvent userEvt;
                        synchronized(itsNatDoc)
                        {
                            userEvt = (ItsNatUserEvent)itsNatDoc.createEvent("itsnat:UserEvents");
                            userEvt.initEvent("itsnat:user:myEvent",false,false);
                        }

                        ((EventTarget)userButton).dispatchEvent(userEvt);
                    }
                    };
View Full Code Here

        eventKey.initKeyEvent("keypress",true,true,((DocumentView)doc).getDefaultView(),
                false,false,false,false,0,'a'); // 'a' = 97
        ((ItsNatNormalEvent)eventKey).setExtraParam("extra","Bye");
        boolean res2 = ((EventTarget)nodeToClick).dispatchEvent(eventKey);

        ItsNatUserEvent userEvent = (ItsNatUserEvent)((DocumentEvent)doc).createEvent("itsnat:UserEvents");
        userEvent.initEvent("itsnat:user:test",false,false);
        userEvent.setExtraParam("extra","UserVal");
        boolean res3 = ((EventTarget)nodeToClick).dispatchEvent(userEvent);

        //clientDoc.addEventListener((EventTarget)nodeToClick,"itsnat:continue",listener,false);
        clientDoc.addContinueEventListener((EventTarget)nodeToClick, this);
        ItsNatContinueEvent continueEvent = (ItsNatContinueEvent)((DocumentEvent)doc).createEvent("itsnat:ContinueEvents");
View Full Code Here

                    // Alternatives:
                    // itsNatDoc.dispatchEvent((EventTarget)buttonElem,mouseEvt);
                    // clientDoc.dispatchEvent((EventTarget)buttonElem,mouseEvt);
                }

                ItsNatUserEvent userEvt;
                synchronized(itsNatDoc)
                {
                    Document doc = itsNatDoc.getDocument();
                    userEvt = (ItsNatUserEvent)((DocumentEvent)doc).createEvent("itsnat:UserEvents");
                    userEvt.initEvent("itsnat:user:myEvent",false,false);
                }

                ((EventTarget)userButton).dispatchEvent(userEvt);
            }
        };
View Full Code Here

            Element buttonElem = buttonElems[i];
            ((EventTarget)buttonElem).dispatchEvent(event);
            // Alternative: itsNatDoc.dispatchEvent((EventTarget)buttonElem,event);
        }

        ItsNatUserEvent userEvt = (ItsNatUserEvent)((DocumentEvent)doc).createEvent("itsnat:UserEvents");
        userEvt.initEvent("itsnat:user:myEvent",false,false);

        ((EventTarget)userButton).dispatchEvent(userEvt);
     }
View Full Code Here

                    eventChange = (Event)((DocumentEvent)doc).createEvent("HTMLEvents");
                }
                eventChange.initEvent("blur",true,true);
                boolean res3 = ((EventTarget)nodeToClick).dispatchEvent(eventChange);

                ItsNatUserEvent userEvent;
                synchronized(itsNatDoc) // no hace falta pero por si acaso
                {
                    userEvent = (ItsNatUserEvent)((DocumentEvent)doc).createEvent("itsnat:UserEvents");
                }
                userEvent.initEvent("itsnat:user:test",false,false);
                userEvent.setExtraParam("extra","\"Hello\"");
                boolean res4 = ((EventTarget)nodeToClick).dispatchEvent(userEvent);

                // No hace testear/disparar ContinueEvent pues se dispara
                // solo al registrar un continue listener
View Full Code Here

TOP

Related Classes of org.itsnat.core.event.ItsNatUserEvent

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.