Sets the view parent.

@param parent
the parent view
549201
@Override
    public void setParent(View parent)
    {

        if (parent == null && view != null) view.setParent(null);
        this.parent = parent;

        // if set new parent and has some element, try to load children
        // this element is a BranchElement ("collection"),
        // so we should have some LeafElements ("children")
        if ((parent != null) && (getElement() != null))
        {
            ViewFactory f = getViewFactory();
            loadChildren(f);
        }
    }
547993
public void init(Object parent, Object record)
    {
        super.init(parent, record);
        this.setOpaque(false);
        this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
        this.addButtons();
    }
398549
public static void setConfiguredSize(
      final View parentView,
      final View draweeView,
      final Config config) {
    if (parentView != null) {
      if (config.overrideSize) {
        SizeUtil.updateViewLayoutParams(
            draweeView,
            config.overridenWidth,
            config.overridenHeight);
      } else {
        int size = SizeUtil.calcDesiredSize(
            parentView.getContext(),
            parentView.getWidth(),
            parentView.getHeight());
        SizeUtil.updateViewLayoutParams(draweeView, size, (int) (size / Const.RATIO));
      }
    }
  }
1242527
public static void removeFromParent(@NonNull final View view) {
        Condition.INSTANCE.ensureNotNull(view, "The view may not be null");
        ViewParent parent = view.getParent();

        if (parent instanceof ViewGroup) {
            ((ViewGroup) parent).removeView(view);
        }
    }
368576
def _set_parent(self, parent=None):
        
        if parent is not None:
            if not isinstance(parent, Parentable):
                raise ValueError('Parent object must implement Parentable interface.')
            if parent is self or parent._contains(self):
                raise ValueError('Self references are not allowed.')
        self._parent = parent if parent is not None else None
1203821
public void setParent(HierarchicalFormModel parent) {
		Assert.notNull(parent, "parent");
		this.parent = parent;
		this.parent.addPropertyChangeListener(ENABLED_PROPERTY, parentStateChangeHandler);
		this.parent.addPropertyChangeListener(READONLY_PROPERTY, parentStateChangeHandler);
		enabledUpdated();
		readOnlyUpdated();
	}
449956
public function setParent($parent)
    {
        if (!empty($parent)) {
            $this->_parent = $this->_normalizeClass($parent);
        } else {
            $this->_parent = null;
        }

        return $this;
    }
406527
private Entry setParent(Entry entry, Entry parent) {
        unlinkFromNeighbors(entry);
        entry.oParent = parent;
        parent.oFirstChild = mergeLists(entry, parent.oFirstChild);
        parent.degree++;
        entry.isMarked = false;

        return parent;
    }
237556
public void setParentResource(CmsResource parentResource) {

        if (parentResource.isFile()) {
            m_parentPath = CmsResource.getFolderPath(parentResource.getRootPath());
        } else {
            m_parentPath = parentResource.getRootPath();
        }
    }
421865
public final void setParent(ElementBase parent) {
        ElementBase oldParent = this.parent;
        
        if (oldParent == parent) {
            return;
        }
        
        if (oldParent != null) {
            oldParent.removeChild(this, false);
        }
        
        if (parent != null) {
            parent.addChild(this);
        }
    }
803410
public void setMenuView(View view) {
        setMenuView(view, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    }
809827
public static void setParents(final Parse p) {
    final Parse[] children = p.getChildren();
    for (final Parse element : children) {
      element.setParent(p);
      setParents(element);
    }
  }
1174681
public function setParent($parent)
    {
        if ($parent !== null &&  !$parent instanceof BaseEntry) {
            throw new \InvalidArgumentException('An entry may only have another entry as parent');
        }

        $this->parent = $parent;
    }
867911
public void show(ViewGroup parent, boolean usePhoneLayout) {
        MarginLayoutParams params = init(parent.getContext(), null, parent, usePhoneLayout);
        updateLayoutParamsMargins(null, params);
        showInternal(null, params, parent);
    }
627384
public function setParent($parent)
	{
		if ($parent instanceof JCategoryNode || is_null($parent))
		{
			if (!is_null($this->_parent))
			{
				$key = array_search($this, $this->_parent->_children);
				unset($this->_parent->_children[$key]);
			}

			if (!is_null($parent))
			{
				$parent->_children[] = & $this;
			}

			$this->_parent = $parent;

			if ($this->id != 'root')
			{
				if ($this->parent_id != 1)
				{
					$this->_path = $parent->getPath();
				}

				$this->_path[] = $this->id . ':' . $this->alias;
			}

			if (count($parent->_children) > 1)
			{
				end($parent->_children);
				$this->_leftSibling = prev($parent->_children);
				$this->_leftSibling->_rightsibling = & $this;
			}
		}
	}
952272
def set_parent(self, node):
        
        self._parent = node

        if node is None:
            # detach from parent
            self._depth = 0
        else:
            self._depth = node.get_depth() + 1
1093973
private void internalSetParent(CommandRegistry parentRegistry) {
        
        if (!ObjectUtils.nullSafeEquals(this.parent, parentRegistry)) {
            
            if (this.parent != null) {
                this.parent.removeCommandRegistryListener(this);
            }
            
            this.parent = parentRegistry;
            
            if (this.parent != null) {
                this.parent.addCommandRegistryListener(this);
            }
            
        }
        
    }