001/*
002 * (C) Copyright 2006-2007 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Jean-Marc Orliaguet, Chalmers
018 *
019 * $Id$
020 */
021
022package org.nuxeo.theme.nodes;
023
024import java.util.List;
025
026public interface Node {
027
028    NodeTypeFamily getNodeTypeFamily();
029
030    void clearParent();
031
032    void setParent(Node node) throws NodeException;
033
034    Node getParent();
035
036    Node addChild(Node node) throws NodeException;
037
038    void removeChild(Node node) throws NodeException;
039
040    List<Node> getChildren();
041
042    void setChildren(List<Node> children) throws NodeException;
043
044    Integer getOrder();
045
046    void setOrder(Integer order) throws NodeException;
047
048    void moveTo(Node container, Integer order) throws NodeException;
049
050    boolean isLeaf();
051
052    void insertAfter(Node node) throws NodeException;
053
054    boolean hasSiblings();
055
056    Node getNextNode();
057
058    Node getPreviousNode();
059
060    boolean hasChildren();
061
062    boolean isChildOf(Node node);
063
064    void removeDescendants() throws NodeException;
065
066    List<Node> getDescendants();
067
068    void collectDescendants(List<Node> nodes);
069
070}