Code example for Node

Methods: getAttributes, getNodeName

0
	} 
	 
	// create ButtonWrapperModel element 
	@Override 
	public TreeComponent createClassFromNode(Node node) {
		String name = node.getNodeName();
		if (!(name.equals("direction")))
			return null; 
		NamedNodeMap map = node.getAttributes();
		Attr at = (Attr) map.item(0);
 
		Button button = new Button(this); // create button
		button.setText(at.getValue());
		button.setOnClickListener(this); //setListener
 
		ButtonWrapperModel bwm = new ButtonWrapperModel();
		bwm.setButton(button); // set button
		return bwm;
	} 
 
}