protected static JavaClass addListener( JavaClass jclass, 
									Element root, 
									String[] arrNames,
									Class<? extends Object> listenerClass,
									Class<? extends EventObject> eventClass){
		boolean listenerAdded = false;
		JavaClass innerClass = new JavaClass( Parser.getUniqueId(listenerClass.getSimpleName()));
		innerClass.setExtend( listenerClass );
		
		for(int i = 0; i < arrNames.length; i++ ){
			String[] parts = arrNames[i].split(":");
			String attrName = parts[0];
			String methodName = parts[1];
			String actionMethod = Parser.getAttribute(root, attrName);
			JavaMethod performMethod = new JavaMethod(methodName, new JavaParam( "e", eventClass.getSimpleName()) );
			if( actionMethod == null ){
				// Not declared as an attribute,
				// can be declared as embedded code in the XML...
				Element e = Parser.getChildElement(root, attrName);
				if( e!= null ){
					// We have some code available...
					performMethod.addCode( Parser.getTextContents(e) );
					innerClass.addMethod(performMethod);
					listenerAdded = true;
					root.removeChild(e); // Remove to avoid side-effects
				}
			}
			else {
				// Method name included in the attributes.
				boolean eventParam = false;
				if( actionMethod.endsWith("+")){
					// The parameter for the event must be added.
					eventParam = true;
					actionMethod = actionMethod.substring(0,actionMethod.length()-1);
				}
				jclass.addImport(JOptionPane.class);
				JavaMethod method = new JavaMethod( actionMethod );
				jclass.addImport(UnsupportedOperationException.class);
				method.setReturnType( new JavaType("void", JavaType.PROTECTED ));
				method.addCode("throw new " + UnsupportedOperationException.class.getSimpleName() + "(\"Not implemented\");" );

				if( eventParam ){
					performMethod.addCall(actionMethod, "e");
					method.setParams(new JavaParam("e", new JavaType(eventClass.getSimpleName(),JavaType.PACKAGE)));
				}
				else{
					// without any parameter
					performMethod.addCall(actionMethod);
				}
				jclass.addMethodIfNotExists( method );
				innerClass.addMethod(performMethod);
				listenerAdded = true;
			}
		}
		if( listenerAdded ){
			jclass.addImport(listenerClass);
			jclass.addImport(eventClass);
			return innerClass;
		}
		return null;
	}