Code example for Element

Methods: getAttribute

0
		target="logout"  
		img="/images/neogia/001_42.png"/> 
     */ 
    public ModelMenuItem(Element element) {
         
        setName(element.getAttribute("name"));
        setValue(element.getAttribute("value"));
        setType(element.getAttribute("type"));
        //setType("image"); 
        if(!"".equals(element.getAttribute("cell-width")))
            setWeight(Integer.valueOf(element.getAttribute("cell-width")));
        /*/>>>>>>>>>>>>>>>>>>>>>>>>>>>>>  
         * we use another way to know the type instead of this 
        if(type.equals("image")) { 
            setImgSrc(element.getAttribute("img")); 
            setTarget(element.getAttribute("target")); 
        }else if(type.equals("text")) { 
            setText(element.getAttribute("text")); 
            setColor(element.getAttribute("color")); 
            setStyle(element.getAttribute("style")); 
            if(!"".equals(element.getAttribute("size"))) 
                setSize(Integer.valueOf(element.getAttribute("size"))); 
        } 
        //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/ 
        setImgSrc(element.getAttribute("img"));
        setTarget(element.getAttribute("target"));
        setTitle(element.getAttribute("title"));
        if(imgSrc.equals("")){
//            if(target.equals("")) 
                setType("text"); 
//            else 
//                setType("button");