Package manual.comp.custom

Examples of manual.comp.custom.LoginComponent


    public static void USER_DEFINED_COMPONENTS_2()
    {
        final ItsNatDocument itsNatDoc = null;
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();

        final LoginComponent loginComp = (LoginComponent)componentMgr.createItsNatComponentById("loginCompId","login",null);

        ValidateLoginListener validator = new ValidateLoginListener()
        {
            public boolean validate(String user,String password)
            {
                if (!user.equals("admin"))
                {
                    System.out.println("Bad user");
                    return false;
                }

                if (!password.equals("1234"))
                {
                    System.out.println("Bad password");
                    return false;
                }

                Element loginElem = (Element)loginComp.getNode();
                loginElem.setAttribute("style","display:none");

                Document doc = loginElem.getOwnerDocument();
                Element infoElem = doc.createElement("p");
                infoElem.appendChild(doc.createTextNode("VALID LOGIN!"));
                loginElem.getParentNode().insertBefore(infoElem,loginElem);

                return true;
            }
        };
        loginComp.setValidateLoginListener(validator);
    }
View Full Code Here

TOP

Related Classes of manual.comp.custom.LoginComponent

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.