All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.intarsys.tools.tree.DeclaredPropertiesNode Maven / Gradle / Ivy

There is a newer version: 4.11
Show newest version
package de.intarsys.tools.tree;

import java.util.ArrayList;
import java.util.List;

/**
 * A generic {@link PropertiesNode} to collect predefined property children.
 * These are for example created by the parent node directly.
 * 
 */
public class DeclaredPropertiesNode extends PropertiesNode {

	private List properties = new ArrayList();

	public DeclaredPropertiesNode(CommonNode parent, Object object) {
		super(parent, object);
	};

	public void addPropertyNode(CommonNode node) {
		properties.add(node);
		updateChildren();
	}

	public void clearPropertyNodes() {
		properties.clear();
		unlinkChildren();
	}

	@Override
	protected void createPropertyNodes(List pProperties) {
		pProperties.addAll(properties);
	}

	public boolean isEmpty() {
		return properties.size() == 0;
	}

	public void removePropertyNode(CommonNode node) {
		properties.remove(node);
		node.unlink();
		updateChildren();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy