Creates an drag container element.<p>

@param element the DOM element
@param dragParent the drag parent
@param elementData the element data

@return the draggable element
194553
private CmsContainerPageElementPanel createElement(
        Element element,
        I_CmsDropContainer dragParent,
        CmsContainerElement elementData) {

        CmsContainerPageElementPanel dragElement = new CmsContainerPageElementPanel(
            element,
            dragParent,
            elementData.getClientId(),
            elementData.getSitePath(),
            elementData.getNoEditReason(),
            elementData.getTitle(),
            elementData.getSubTitle(),
            elementData.getResourceType(),
            elementData.hasSettings(dragParent.getContainerId()),
            elementData.hasViewPermission(),
            elementData.hasWritePermission(),
            elementData.isReleasedAndNotExpired(),
            elementData.isNewEditorDisabled(),
            elementData.hasEditHandler(),
            elementData.getModelGroupId(),
            elementData.isWasModelGroup(),
            elementData.getElementView(),
            elementData.getBigIconClasses());
        dragElement.setCreateNew(elementData.isCreateNew());
        if (m_controller.requiresOptionBar(dragElement, dragParent)) {
            addOptionBar(dragElement);
        }
        if (m_controller.isInlineEditable(dragElement, dragParent)) {
            dragElement.initInlineEditor(m_controller);
        }
        return dragElement;
    }
82849
public final void swapTagWithParent(final Element root,
            final String selector) {
        final Iterable<Element> elements; // Selected elements
        Element parent;                   // Parent element
        String text;                      // Preserved text

        checkNotNull(root, "Received a null pointer as root element");
        checkNotNull(selector, "Received a null pointer as selector");

        // Selects and iterates over the elements
        elements = root.select(selector);
        for (final Element element : elements) {
            parent = element.parent();

            // Takes the text out of the element
            text = element.text();
            element.text("");

            // Swaps elements
            parent.replaceWith(element);
            element.appendChild(parent);

            // Sets the text into what was the parent element
            parent.text(text);
        }
    }
585287
function ( e )
	{
		var that = this;

		if ( this.dom.drag === null )
		{
			/* Only create the drag element if the mouse has moved a specific distance from the start
			 * point - this allows the user to make small mouse movements when sorting and not have a
			 * possibly confusing drag element showing up
			 */
			if ( Math.pow(
				Math.pow(e.pageX - this.s.mouse.startX, 2) +
				Math.pow(e.pageY - this.s.mouse.startY, 2), 0.5 ) < 5 )
			{
				return;
			}
			this._fnCreateDragNode();
		}

		/* Position the element - we respect where in the element the click occured */
		this.dom.drag.css( {
			left: e.pageX - this.s.mouse.offsetX,
			top: e.pageY - this.s.mouse.offsetY
		} );

		/* Based on the current mouse position, calculate where the insert should go */
		var bSet = false;
		var lastToIndex = this.s.mouse.toIndex;

		for ( var i=1, iLen=this.s.aoTargets.length ; i<iLen ; i++ )
		{
			if ( e.pageX < this.s.aoTargets[i-1].x + ((this.s.aoTargets[i].x-this.s.aoTargets[i-1].x)/2) )
			{
				this.dom.pointer.css( 'left', this.s.aoTargets[i-1].x );
				this.s.mouse.toIndex = this.s.aoTargets[i-1].to;
				bSet = true;
				break;
			}
		}

		// The insert element wasn't positioned in the array (less than
		// operator), so we put it at the end
		if ( !bSet )
		{
			this.dom.pointer.css( 'left', this.s.aoTargets[this.s.aoTargets.length-1].x );
			this.s.mouse.toIndex = this.s.aoTargets[this.s.aoTargets.length-1].to;
		}

		// Perform reordering if realtime updating is on and the column has moved
		if ( this.s.init.bRealtime && lastToIndex !== this.s.mouse.toIndex ) {
			this.s.dt.oInstance.fnColReorder( this.s.mouse.fromIndex, this.s.mouse.toIndex );
			this.s.mouse.fromIndex = this.s.mouse.toIndex;
			this._fnRegions();
		}
	}
798575
public static Element getChild( Element root, String name )
    {
        if( null == root )
        {
            return null;
        }
        NodeList list = root.getElementsByTagName( name );
        int n = list.getLength();
        if( n < 1 )
        {
            return null;
        }
        return (Element) list.item( 0 );
    }
93341
function(node, dragElements) {
      node._private.grabbed = true;
      node._private.rscratch.inDragLayer = true;

      dragElements.push(node);

      for (var i=0;i<node._private.edges.length;i++) {
        node._private.edges[i]._private.rscratch.inDragLayer = true;
      }

      //node.trigger(new $$.Event(e, {type: 'grab'}));
    }
823841
public static Element dataElement(Element context, String name) {
        return context != null ? context.querySelector("[data-element=" + name + "]") : null;
    }
1128363
protected CmsContainerElementBean getParentElement(CmsContainerElementBean element) {

        if (m_elementInstances == null) {
            initPageData();
        }
        CmsContainerElementBean parent = null;
        CmsContainerBean cont = m_parentContainers.get(element.getInstanceId());
        if ((cont != null) && cont.isNestedContainer()) {
            parent = m_elementInstances.get(cont.getParentInstanceId());
        }
        return parent;
    }
744514
public static Element getElement(Element element, String tagName) {
		final NodeList nodeList = element.getElementsByTagName(tagName);
		if (nodeList == null || nodeList.getLength() < 1) {
			return null;
		}
		int length = nodeList.getLength();
		for (int i = 0; i < length; i++) {
			Element childEle = (Element) nodeList.item(i);
			if (childEle == null || childEle.getParentNode() == element) {
				return childEle;
			}
		}
		return null;
	}
191114
protected Element createTextElement(String data, float width)
    {
        Element el = createTextElement(width);
        Text text = doc.createTextNode(data);
        el.appendChild(text);
        return el;
    }
238080
function createDragger(el){
            var state = getState(el);

            var dragger = document.createElement('div');
            var draggerStyler = document.createElement('div');

            dragger.className = state.config.draggerClass;

            dragger.style.position = 'absolute';

            if (!state.draggerEnabled) {
                dragger.style.display = 'none';
            }

            draggerStyler.className = state.config.draggerStylerClass;

            dragger.appendChild(draggerStyler);
            state.el1.appendChild(dragger);

            return dragger;
        }
368746
public static Element appendElement(Element parent, String tagName) {
        Element child = parent.getOwnerDocument().createElement(tagName);
        parent.appendChild(child);
        return child;
    }
562915
function (sortableElement) {
        var opts = addData(sortableElement, 'opts') || {};
        var items = _filter(sortableElement.children, opts.items);
        var handles = _getHandles(items, opts.handle);
        // remove event handlers & data from sortable
        removeEventListener(sortableElement, 'dragover');
        removeEventListener(sortableElement, 'dragenter');
        removeEventListener(sortableElement, 'drop');
        // remove event data from sortable
        _removeSortableData(sortableElement);
        // remove event handlers & data from items
        removeEventListener(handles, 'mousedown');
        _removeItemEvents(items);
        _removeItemData(items);
    }
735086
public static Element getChild(Element parent, String childName) {
		NodeList nodes = parent.getChildNodes();
		for (int i = 0; i < nodes.getLength(); ++i) {
			Node node = nodes.item(i);
			if ((node instanceof Element) && node.getNodeName().equals(childName))
				return (Element)node;
		}
		return null;
	}
1095483
public Element createElement(org.w3c.dom.Element element, Element parent) throws
      InvalidInputException {
    String tag = element.getNodeName();

    if (Header.isHeaderElement(tag)) {
      return new Header(parent, tag);
    }

    switch (tag) {
      case Chime.MESSAGEML_TAG:
        validateFormat(tag);
        return new Chime(parent, FormatEnum.MESSAGEML);

      case Chime.PRESENTATIONML_TAG:
        return new Chime(parent, FormatEnum.PRESENTATIONML);

      case Paragraph.MESSAGEML_TAG:
        return new Paragraph(parent);

      case LineBreak.MESSAGEML_TAG:
        return new LineBreak(parent);

      case HorizontalRule.MESSAGEML_TAG:
        return new HorizontalRule(parent);

      case Span.MESSAGEML_TAG:
        switch (element.getAttribute(CLASS_ATTR)) {
          case Entity.PRESENTATIONML_CLASS:
            return createEntity(element, parent);
          default:
            return new Span(parent);
        }

      case Div.MESSAGEML_TAG:
        switch (element.getAttribute(CLASS_ATTR)) {
          case Entity.PRESENTATIONML_CLASS:
            return createEntity(element, parent);
          case Card.PRESENTATIONML_CLASS:
            element.removeAttribute(CLASS_ATTR);
            return new Card(parent, FormatEnum.PRESENTATIONML);
          case CardBody.PRESENTATIONML_CLASS:
            element.removeAttribute(CLASS_ATTR);
            return new CardBody(parent, FormatEnum.PRESENTATIONML);
          case CardHeader.PRESENTATIONML_CLASS:
            element.removeAttribute(CLASS_ATTR);
            return new CardHeader(parent, FormatEnum.PRESENTATIONML);
          default:
            return new Div(parent);
        }

      case Bold.MESSAGEML_TAG:
        return new Bold(parent);

      case Italic.MESSAGEML_TAG:
        return new Italic(parent);

      case Preformatted.MESSAGEML_TAG:
        return new Preformatted(parent);

      case HashTag.MESSAGEML_TAG:
        validateFormat(tag);
        return new HashTag(parent, ++index);

      case CashTag.MESSAGEML_TAG:
        validateFormat(tag);
        return new CashTag(parent, ++index);

      case Mention.MESSAGEML_TAG:
        validateFormat(tag);
        return new Mention(parent, ++index, dataProvider);

      case Link.MESSAGEML_TAG:
        return new Link(parent, dataProvider);

      case Image.MESSAGEML_TAG:
        return new Image(parent);

      case BulletList.MESSAGEML_TAG:
        return new BulletList(parent);

      case OrderedList.MESSAGEML_TAG:
        return new OrderedList(parent);

      case ListItem.MESSAGEML_TAG:
        return new ListItem(parent);

      case Table.MESSAGEML_TAG:
        return new Table(parent);

      case TableHeader.MESSAGEML_TAG:
        return new TableHeader(parent);

      case TableBody.MESSAGEML_TAG:
        return new TableBody(parent);

      case TableFooter.MESSAGEML_TAG:
        return new TableFooter(parent);

      case TableRow.MESSAGEML_TAG:
        return new TableRow(parent);

      case TableHeaderCell.MESSAGEML_TAG:
        return new TableHeaderCell(parent);

      case TableCell.MESSAGEML_TAG:
        return new TableCell(parent);

      case Card.MESSAGEML_TAG:
        validateFormat(tag);
        return new Card(parent, FormatEnum.MESSAGEML);

      case Code.MESSAGEML_TAG:
        return new Code(parent);

      case CardHeader.MESSAGEML_TAG:
        validateFormat(tag);
        return new CardHeader(parent, FormatEnum.MESSAGEML);

      case CardBody.MESSAGEML_TAG:
        validateFormat(tag);
        return new CardBody(parent, FormatEnum.MESSAGEML);

      case Emoji.MESSAGEML_TAG:
        return new Emoji(parent, ++index);

      case Form.MESSAGEML_TAG:
        return new Form(parent);

      case Button.MESSAGEML_TAG:
        return new Button(parent);

      default:
        throw new InvalidInputException("Invalid MessageML content at element \"" + tag + "\"");
    }
  }
639816
public static Element createElement(String localPart)
   {
      Document doc = getOwnerDocument();
      if (ROOT_LOGGER.isTraceEnabled()) ROOT_LOGGER.trace("createElement {}" + localPart);
      return doc.createElement(localPart);
   }
539475
function createElement (
	  tag,
	  data,
	  children
	) {
	  if (data && (Array.isArray(data) || typeof data !== 'object')) {
	    children = data;
	    data = undefined;
	  }
	  // make sure to use real instance instead of proxy as context
	  return _createElement(this._self, tag, data, children)
	}
547917
public static Element appendCDATAElement(Element parent, String tagName,
            String value) {
        Element child = appendElement(parent, tagName);
        if (value == null) { // avoid "null" word in the XML payload
            value = "";
        }

        Node cdata = child.getOwnerDocument().createCDATASection(value);
        child.appendChild(cdata);
        return child;
    }