Code example for Node

Methods: getAttributes

0
public class FactoryMethodContentAssistCalculator implements IContentAssistCalculator { 
 
	public void computeProposals(IContentAssistContext context,
			IContentAssistProposalRecorder recorder) {
		Node node = context.getNode();
		NamedNodeMap attributes = node.getAttributes();
		Node factoryBean = getFactoryBeanReferenceNode(attributes);
 
		String factoryClassName = null;
		boolean isStatic;
		if (factoryBean != null) {
			// instance factory method 
			factoryClassName = BeansEditorUtils.getClassNameForBean(context.getFile(), context
					.getDocument(), factoryBean.getNodeValue());
			isStatic = false;
		} 
		else { 
			// static factory method 
			factoryClassName = BeansEditorUtils.getAttribute(node, "class");
			isStatic = true;
		} 
 
		if (factoryClassName != null) {
			addFactoryMethodAttributeValueProposals(recorder, context, factoryClassName, isStatic);