Adds all people, software systems, sibling containers and components that are directly connected to the specified element.

@param element   an Element
977602
@Override
    public void addNearestNeighbours(@Nonnull Element element) {
        super.addNearestNeighbours(element, SoftwareSystem.class);
        super.addNearestNeighbours(element, Person.class);
        super.addNearestNeighbours(element, Container.class);
        super.addNearestNeighbours(element, Component.class);
    }
1232018
public T addElement(T element) {
		// make sure that elements are initialized
		getElements();
		if (!containsElement(this.elements, element)) {
			this.elements.add(element);
			element.addChangeListener(this.elementChangeListener);
			element.notifyState();
			return element;
		}
		throw new RuntimeException(element.toString() + " already exists");
	}
450272
private void checkElement(Element elementToBeAdded) {
        if (!(elementToBeAdded instanceof Person) && !(elementToBeAdded instanceof SoftwareSystem) && !(elementToBeAdded instanceof Container) && !(elementToBeAdded instanceof Component)) {
            throw new IllegalArgumentException("Only people, software systems, containers and components can be added to dynamic views.");
        }

        // people can always be added
        if (elementToBeAdded instanceof Person) {
            return;
        }

        // if the scope of this dynamic view is a software system, we only want:
        //  - containers inside that software system
        //  - other software systems
        if (element instanceof SoftwareSystem) {
            if (elementToBeAdded.equals(element)) {
                throw new IllegalArgumentException(elementToBeAdded.getName() + " is already the scope of this view and cannot be added to it.");
            }
            if (elementToBeAdded instanceof Container && !elementToBeAdded.getParent().equals(element)) {
                throw new IllegalArgumentException("Only containers that reside inside " + element.getName() + " can be added to this view.");
            }
            if (elementToBeAdded instanceof Component) {
                throw new IllegalArgumentException("Components can't be added to a dynamic view when the scope is a software system.");
            }
        }

        // if the scope of this dynamic view is a container, we only want other containers inside the same software system
        // and other components inside the container
        if (element instanceof Container) {
            if (elementToBeAdded.equals(element) || elementToBeAdded.equals(element.getParent())) {
                throw new IllegalArgumentException(elementToBeAdded.getName() + " is already the scope of this view and cannot be added to it.");
            }
            if (elementToBeAdded instanceof Container && !elementToBeAdded.getParent().equals(element.getParent())) {
                throw new IllegalArgumentException("Only containers that reside inside " + element.getParent().getName() + " can be added to this view.");
            }

            if (elementToBeAdded instanceof Component && !elementToBeAdded.getParent().equals(element)) {
                throw new IllegalArgumentException("Only components that reside inside " + element.getName() + " can be added to this view.");
            }
        }

        if (element == null) {
            if (!(elementToBeAdded instanceof SoftwareSystem)) {
                throw new IllegalArgumentException("Only people and software systems can be added to this dynamic view.");
            }
        }
    }
948665
public function addElement($element)
    {
        if ($this->processing === 'B') {
            $this->pdf->addBody($element);

            return;
        }

        if ($this->processing === 'H') {
            $this->pdf->addHeader($element);

            return;
        }

        if ($this->processing === 'F') {
            $this->pdf->addFooter($element);

            return;
        }
    }
138655
public ElementsBuilder addAll(IsElement... elements) {
        for (IsElement element : elements) {
            add(element);
        }
        return that();
    }
1099473
private void addChildElements() {
        for (Node node : nodes) {
        	if(node instanceof NestableNode) {
	            List<Node> nl = ((NestableNode) node).getChildren();
	            for (Node n : nl) {
	                if (!(n instanceof Element)) {
	                    continue;
	                }
	                
	                String tag = selector.getTagName();
	                if (tagEquals(tag, ((Element)n).getNormalizedName()) || tag.equals(Selector.UNIVERSAL_TAG)) {
	                    result.add(n);
	                }
	            }
        	}
        }
    }
1109014
public void add (T element)
    {
        DependencyNode<T> node = new DependencyNode<T>(element);
        _nodes.put(element, node);
        _orphans.add(element);
    }
523205
public static CmsInlineEditOverlay addOverlayForElement(Element element) {

        CmsInlineEditOverlay overlay = new CmsInlineEditOverlay(element);
        if (!m_overlays.isEmpty()) {
            m_overlays.get(m_overlays.size() - 1).setVisible(false);
        }
        m_overlays.add(overlay);
        RootPanel.get().add(overlay);
        overlay.updatePosition();
        overlay.checkZIndex();
        return overlay;
    }
355911
protected void replaceWithChildren(Element element)
    {
        Element parent = (Element) element.getParentNode();
        while (element.getFirstChild() != null) {
            parent.insertBefore(element.removeChild(element.getFirstChild()), element);
        }
        parent.removeChild(element);
    }
650254
public static void appendElement(Element parent, Element child) {
        Node tmp = parent.getOwnerDocument().importNode(child, true);
        parent.appendChild(tmp);
    }
1267947
public static void addDisablingOverlay(Element element) {

        Element overlay = DOM.createDiv();
        overlay.addClassName(I_CmsLayoutBundle.INSTANCE.generalCss().disablingOverlay());
        element.getStyle().setPosition(Position.RELATIVE);
        element.appendChild(overlay);
    }
82937
@Override
    public void add(int index, E element) {
        final ReentrantLock lock = this.lock;
        lock.lock();
        try {
            Object[] elements = getArray();
            int len = elements.length;
            if (index > len || index < 0)
                throw new IndexOutOfBoundsException("Index: " + index +
                                                    ", Size: " + len);
            Object[] newElements;
            int numMoved = len - index;
            if (numMoved == 0)
                newElements = Arrays.copyOf(elements, len + 1);
            else {
                newElements = new Object[len + 1];
                System.arraycopy(elements, 0, newElements, 0, index);
                System.arraycopy(elements, index, newElements, index + 1,
                                 numMoved);
            }
            newElements[index] = element;
            setArray(newElements);
        } finally {
            lock.unlock();
        }
    }
1218063
protected void addElements(Map<String, CmsContainerElementData> elements) {

        for (CmsContainerElementData element : elements.values()) {
            m_elements.put(element.getClientId(), element);
        }
    }
167810
@Override
    public void processElement(Wrapper<Element> element) {
        activeElement = element.getContent();
        
        if (parentElement != null) {
            parentElement.addContent(activeElement);
        }
    }
226773
@Override
  public boolean add(int element)
  {
    if (element < 0) {
      throw new IndexOutOfBoundsException("element < 0: " + element);
    }
    int index = findElementOrRemoved(element);
    if (index >= 0) {
      if (cells[index] == element) {
        return false;
      }
      freecells--;
    } else {
      index = -(index + 1);
    }

    modCount++;
    size++;

    // set the integer
    cells[index] = element;

    // do we need to rehash?
    if (1 - ((double) freecells / cells.length) > LOAD_FACTOR) {
      rehash();
    }
    return true;
  }
568459
public void add(RtfBasicElement element) {
        try {
            if(element instanceof RtfInfoElement) {
                this.documentHeader.addInfoElement((RtfInfoElement) element);
            } else {
                if(element instanceof RtfImage) {
                    ((RtfImage) element).setTopLevelElement(true);
                }
                element.writeContent( this.data.getOutputStream() );
                this.lastElementWritten = element;
            }
        } catch(IOException ioe) {
            ioe.printStackTrace();
        }
    }
1029437
public void push(final T element) {
    int newSize = this.size + 1;
    this.ensure(newSize);
    this.elements[this.size++] = element;
  }